@jetbrains/ring-ui 7.0.62 → 7.0.63

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 (386) hide show
  1. package/components/alert/alert.css +1 -1
  2. package/components/alert/alert.d.ts +1 -1
  3. package/components/alert/alert.js +3 -3
  4. package/components/alert/container.css +2 -2
  5. package/components/alert/container.d.ts +1 -1
  6. package/components/alert/container.js +1 -1
  7. package/components/alert-service/alert-service.d.ts +2 -2
  8. package/components/analytics/{analytics__custom-plugin.d.ts → analytics-custom-plugin.d.ts} +1 -1
  9. package/components/analytics/{analytics__custom-plugin.js → analytics-custom-plugin.js} +2 -2
  10. package/components/auth/{auth__core.d.ts → auth-core.d.ts} +9 -8
  11. package/components/auth/{auth__core.js → auth-core.js} +14 -18
  12. package/components/auth/auth.d.ts +2 -2
  13. package/components/auth/auth.js +2 -2
  14. package/components/auth/background-flow.d.ts +2 -2
  15. package/components/auth/background-flow.js +0 -1
  16. package/components/auth/down-notification.css +1 -1
  17. package/components/auth/down-notification.js +1 -1
  18. package/components/auth/iframe-flow.d.ts +3 -3
  19. package/components/auth/iframe-flow.js +3 -5
  20. package/components/auth/request-builder.d.ts +2 -1
  21. package/components/auth/request-builder.js +1 -2
  22. package/components/auth/storage.d.ts +3 -3
  23. package/components/auth/storage.js +4 -8
  24. package/components/auth/token-validator.d.ts +2 -1
  25. package/components/auth/token-validator.js +6 -1
  26. package/components/auth/window-flow.d.ts +3 -3
  27. package/components/auth/window-flow.js +7 -7
  28. package/components/auth-dialog/auth-dialog.css +2 -2
  29. package/components/auth-dialog/auth-dialog.js +1 -1
  30. package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
  31. package/components/avatar/avatar-info.d.ts +1 -1
  32. package/components/avatar/avatar.css +1 -1
  33. package/components/avatar/avatar.d.ts +1 -1
  34. package/components/avatar/avatar.figma.js +1 -1
  35. package/components/avatar/avatar.js +5 -7
  36. package/components/avatar/fallback-avatar.js +4 -8
  37. package/components/avatar-stack/avatar-stack.css +1 -1
  38. package/components/avatar-stack/avatar-stack.d.ts +3 -3
  39. package/components/avatar-stack/avatar-stack.figma.js +1 -1
  40. package/components/avatar-stack/avatar-stack.js +1 -1
  41. package/components/banner/banner.css +2 -2
  42. package/components/banner/banner.js +1 -1
  43. package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
  44. package/components/breadcrumbs/breadcrumbs.figma.js +1 -1
  45. package/components/button/{button__classes.d.ts → button.classes.d.ts} +1 -1
  46. package/components/button/button.css +19 -16
  47. package/components/button/button.d.ts +4 -4
  48. package/components/button/button.figma.js +1 -1
  49. package/components/button/button.js +6 -6
  50. package/components/button-group/button-group.css +6 -6
  51. package/components/button-group/button-group.d.ts +1 -1
  52. package/components/button-group/button-group.js +1 -1
  53. package/components/button-group/caption.d.ts +1 -1
  54. package/components/button-set/button-set.css +2 -2
  55. package/components/button-set/button-set.d.ts +1 -1
  56. package/components/button-toolbar/button-toolbar.css +2 -2
  57. package/components/button-toolbar/button-toolbar.d.ts +1 -1
  58. package/components/caret/caret.js +23 -18
  59. package/components/checkbox/checkbox-group.figma.js +1 -1
  60. package/components/checkbox/checkbox.css +1 -1
  61. package/components/checkbox/checkbox.d.ts +1 -1
  62. package/components/checkbox/checkbox.figma.js +1 -1
  63. package/components/checkbox/checkbox.js +5 -5
  64. package/components/clipboard/clipboard.js +2 -2
  65. package/components/code/code.css +1 -1
  66. package/components/code/code.d.ts +1 -1
  67. package/components/code/code.js +5 -3
  68. package/components/collapse/collapse-content.d.ts +3 -3
  69. package/components/collapse/collapse-control.d.ts +2 -2
  70. package/components/collapse/collapse.css +1 -1
  71. package/components/collapse/collapse.d.ts +3 -3
  72. package/components/confirm/confirm.d.ts +1 -1
  73. package/components/confirm/confirm.js +1 -1
  74. package/components/confirm-service/confirm-service.d.ts +3 -3
  75. package/components/content-layout/content-layout.css +2 -2
  76. package/components/content-layout/content-layout.d.ts +1 -1
  77. package/components/content-layout/content-layout.js +2 -2
  78. package/components/content-layout/sidebar.d.ts +1 -1
  79. package/components/contenteditable/contenteditable.d.ts +1 -1
  80. package/components/contenteditable/contenteditable.js +2 -1
  81. package/components/control-help/control-help.css +1 -1
  82. package/components/control-help/control-help.d.ts +1 -1
  83. package/components/control-label/control-label.d.ts +1 -1
  84. package/components/data-list/data-list.css +1 -1
  85. package/components/data-list/data-list.d.ts +5 -5
  86. package/components/data-list/data-list.js +2 -2
  87. package/components/data-list/data-list.mock.d.ts +2 -2
  88. package/components/data-list/data-list.mock.js +20 -20
  89. package/components/data-list/item.d.ts +3 -3
  90. package/components/data-list/item.js +2 -2
  91. package/components/data-list/selection.d.ts +1 -1
  92. package/components/data-list/selection.js +8 -1
  93. package/components/data-list/title.d.ts +2 -2
  94. package/components/date-picker/consts.d.ts +1 -1
  95. package/components/date-picker/date-input.d.ts +1 -1
  96. package/components/date-picker/date-input.js +2 -2
  97. package/components/date-picker/date-picker.css +15 -15
  98. package/components/date-picker/date-picker.d.ts +5 -5
  99. package/components/date-picker/date-picker.js +17 -19
  100. package/components/date-picker/date-popup.d.ts +1 -1
  101. package/components/date-picker/date-popup.js +5 -3
  102. package/components/date-picker/day.d.ts +2 -2
  103. package/components/date-picker/day.js +4 -5
  104. package/components/date-picker/formats.js +1 -0
  105. package/components/date-picker/month-names.d.ts +1 -1
  106. package/components/date-picker/month-names.js +1 -1
  107. package/components/date-picker/month-slider.d.ts +2 -2
  108. package/components/date-picker/month-slider.js +1 -1
  109. package/components/date-picker/month.d.ts +1 -1
  110. package/components/date-picker/months.d.ts +1 -1
  111. package/components/date-picker/months.js +2 -2
  112. package/components/date-picker/years.d.ts +1 -1
  113. package/components/date-picker/years.js +2 -2
  114. package/components/dialog/{dialog__body-scroll-preventer.js → dialog-body-scroll-preventer.js} +6 -2
  115. package/components/dialog/dialog.css +5 -5
  116. package/components/dialog/dialog.d.ts +1 -1
  117. package/components/dialog/dialog.js +7 -7
  118. package/components/dropdown/anchor.d.ts +1 -1
  119. package/components/dropdown/dropdown.css +1 -1
  120. package/components/dropdown/dropdown.d.ts +2 -2
  121. package/components/dropdown/dropdown.js +2 -2
  122. package/components/dropdown-menu/dropdown-menu.d.ts +5 -5
  123. package/components/dropdown-menu/dropdown-menu.js +1 -1
  124. package/components/editable-heading/editable-heading.css +6 -8
  125. package/components/editable-heading/editable-heading.d.ts +1 -1
  126. package/components/editable-heading/editable-heading.js +3 -2
  127. package/components/error-bubble/error-bubble-legacy.css +3 -3
  128. package/components/error-bubble/error-bubble.css +5 -5
  129. package/components/error-bubble/error-bubble.d.ts +1 -1
  130. package/components/error-bubble/error-bubble.figma.js +1 -1
  131. package/components/error-bubble/error-bubble.js +2 -2
  132. package/components/error-message/error-message.css +1 -1
  133. package/components/error-message/error-message.d.ts +2 -2
  134. package/components/error-message/error-message.js +2 -2
  135. package/components/error-page/error-page.css +3 -3
  136. package/components/footer/footer.css +2 -2
  137. package/components/footer/footer.d.ts +1 -1
  138. package/components/footer/footer.js +1 -1
  139. package/components/form/form.css +3 -3
  140. package/components/global/compose-refs.d.ts +2 -0
  141. package/components/global/compose-refs.js +14 -0
  142. package/components/global/composeRefs.d.ts +6 -2
  143. package/components/global/composeRefs.js +7 -14
  144. package/components/global/create-stateful-context.d.ts +1 -1
  145. package/components/global/dom.d.ts +1 -1
  146. package/components/global/dom.js +2 -4
  147. package/components/global/focus-sensor-hoc.d.ts +1 -1
  148. package/components/global/focus-sensor-hoc.js +2 -2
  149. package/components/global/fuzzy-highlight.d.ts +2 -2
  150. package/components/global/get-event-key.d.ts +1 -1
  151. package/components/global/global.css +2 -2
  152. package/components/global/memoize.js +1 -1
  153. package/components/global/rerender-hoc.d.ts +1 -1
  154. package/components/global/rerender-hoc.js +2 -2
  155. package/components/global/theme.d.ts +1 -1
  156. package/components/global/theme.js +2 -2
  157. package/components/global/url.js +3 -3
  158. package/components/global/use-event-callback.js +1 -1
  159. package/components/global/variables.css +1 -1
  160. package/components/grid/col.d.ts +1 -1
  161. package/components/grid/col.js +1 -1
  162. package/components/grid/grid.css +4 -4
  163. package/components/grid/grid.d.ts +1 -1
  164. package/components/grid/grid.js +1 -1
  165. package/components/grid/row.d.ts +1 -1
  166. package/components/grid/row.js +1 -1
  167. package/components/group/group.css +1 -1
  168. package/components/group/group.d.ts +1 -1
  169. package/components/group/group.js +1 -1
  170. package/components/header/header-icon.d.ts +2 -2
  171. package/components/header/header.css +4 -4
  172. package/components/header/header.d.ts +1 -1
  173. package/components/header/links.d.ts +1 -1
  174. package/components/header/logo.d.ts +1 -1
  175. package/components/header/profile.d.ts +5 -5
  176. package/components/header/profile.js +3 -3
  177. package/components/header/services-link.d.ts +1 -1
  178. package/components/header/services-link.js +3 -3
  179. package/components/header/services.css +1 -1
  180. package/components/header/services.d.ts +2 -2
  181. package/components/header/services.js +3 -3
  182. package/components/header/smart-profile.d.ts +3 -3
  183. package/components/header/smart-profile.js +2 -1
  184. package/components/header/smart-services.d.ts +3 -3
  185. package/components/header/tray.d.ts +1 -1
  186. package/components/heading/heading.css +2 -2
  187. package/components/heading/heading.d.ts +1 -1
  188. package/components/http/http.mock.d.ts +1 -1
  189. package/components/hub-source/{hub-source__user.d.ts → hub-source-user.d.ts} +3 -2
  190. package/components/hub-source/{hub-source__users-groups.d.ts → hub-source-users-groups.d.ts} +3 -2
  191. package/components/hub-source/hub-source.d.ts +2 -2
  192. package/components/icon/{icon__svg.d.ts → icon-svg.d.ts} +1 -1
  193. package/components/icon/icon.css +5 -5
  194. package/components/icon/icon.d.ts +2 -2
  195. package/components/icon/icon.js +3 -3
  196. package/components/input/input-legacy.css +2 -2
  197. package/components/input/input.css +5 -5
  198. package/components/input/input.d.ts +3 -3
  199. package/components/input/input.figma.js +1 -1
  200. package/components/input/input.js +8 -8
  201. package/components/input-size/input-size.css +1 -1
  202. package/components/island/adaptive-island-hoc.d.ts +1 -1
  203. package/components/island/content.d.ts +1 -1
  204. package/components/island/content.js +2 -2
  205. package/components/island/header.d.ts +1 -1
  206. package/components/island/header.js +4 -4
  207. package/components/island/island.css +3 -3
  208. package/components/island/island.d.ts +1 -1
  209. package/components/line/line.css +1 -1
  210. package/components/link/clickable-link.d.ts +12 -0
  211. package/components/link/clickable-link.js +25 -0
  212. package/components/link/clickableLink.d.ts +11 -12
  213. package/components/link/clickableLink.js +4 -25
  214. package/components/link/link.css +1 -1
  215. package/components/link/link.d.ts +2 -2
  216. package/components/link/link.js +4 -4
  217. package/components/list/consts.d.ts +4 -5
  218. package/components/list/{list__custom.d.ts → list-custom.d.ts} +1 -1
  219. package/components/list/{list__custom.js → list-custom.js} +1 -1
  220. package/components/list/{list__hint.d.ts → list-hint.d.ts} +1 -1
  221. package/components/list/{list__hint.js → list-hint.js} +1 -1
  222. package/components/list/{list__item.d.ts → list-item.d.ts} +2 -2
  223. package/components/list/{list__item.js → list-item.js} +6 -5
  224. package/components/list/{list__separator.d.ts → list-separator.d.ts} +1 -1
  225. package/components/list/{list__separator.js → list-separator.js} +1 -1
  226. package/components/list/{list__title.d.ts → list-title.d.ts} +1 -1
  227. package/components/list/{list__title.js → list-title.js} +1 -1
  228. package/components/list/{list__users-groups-source.d.ts → list-users-groups-source.d.ts} +3 -2
  229. package/components/list/{list__users-groups-source.js → list-users-groups-source.js} +1 -1
  230. package/components/list/{list__classes.d.ts → list.classes.d.ts} +1 -1
  231. package/components/list/list.css +5 -5
  232. package/components/list/list.d.ts +7 -7
  233. package/components/list/list.js +34 -28
  234. package/components/loader/{loader__core.js → loader-core.js} +2 -2
  235. package/components/loader/loader.css +1 -1
  236. package/components/loader/loader.d.ts +2 -2
  237. package/components/loader/loader.js +1 -1
  238. package/components/loader-inline/loader-inline.css +2 -2
  239. package/components/loader-inline/loader-inline.d.ts +1 -1
  240. package/components/loader-screen/loader-screen.css +2 -2
  241. package/components/loader-screen/loader-screen.d.ts +1 -1
  242. package/components/login-dialog/login-dialog.css +2 -2
  243. package/components/login-dialog/login-dialog.d.ts +1 -1
  244. package/components/login-dialog/login-dialog.js +1 -1
  245. package/components/login-dialog/service.d.ts +1 -1
  246. package/components/markdown/markdown.css +3 -3
  247. package/components/markdown/markdown.d.ts +1 -1
  248. package/components/markdown/markdown.js +1 -1
  249. package/components/message/message.css +3 -3
  250. package/components/message/message.d.ts +4 -4
  251. package/components/message/message.js +3 -3
  252. package/components/old-browsers-message/old-browsers-message.css +2 -2
  253. package/components/old-browsers-message/old-browsers-message.js +1 -1
  254. package/components/pager/pager.css +1 -1
  255. package/components/pager/pager.d.ts +2 -2
  256. package/components/pager/pager.js +11 -12
  257. package/components/panel/panel.css +1 -1
  258. package/components/panel/panel.d.ts +1 -1
  259. package/components/panel/panel.js +1 -1
  260. package/components/permissions/{permissions__cache.js → permissions-cache.js} +4 -5
  261. package/components/permissions/permissions.d.ts +2 -2
  262. package/components/permissions/permissions.js +2 -4
  263. package/components/popup/popup.css +3 -3
  264. package/components/popup/popup.d.ts +2 -2
  265. package/components/popup/popup.js +6 -5
  266. package/components/popup/popup.target.d.ts +1 -1
  267. package/components/popup/position-css.js +6 -10
  268. package/components/popup/position.js +10 -10
  269. package/components/popup-menu/popup-menu.d.ts +4 -4
  270. package/components/progress-bar/progress-bar.css +6 -8
  271. package/components/progress-bar/progress-bar.d.ts +1 -1
  272. package/components/progress-bar/progress-bar.js +1 -1
  273. package/components/query-assist/{query-assist__suggestions.d.ts → query-assist-suggestions.d.ts} +1 -1
  274. package/components/query-assist/query-assist.css +11 -11
  275. package/components/query-assist/query-assist.d.ts +4 -4
  276. package/components/query-assist/query-assist.js +11 -11
  277. package/components/radio/{radio__item.d.ts → radio-item.d.ts} +1 -1
  278. package/components/radio/{radio__item.js → radio-item.js} +2 -2
  279. package/components/radio/radio.css +2 -2
  280. package/components/radio/radio.d.ts +2 -2
  281. package/components/radio/radio.js +1 -1
  282. package/components/scrollable-section/scrollable-section.d.ts +1 -1
  283. package/components/scrollable-section/scrollable-section.js +1 -1
  284. package/components/select/{select__filter.d.ts → select-filter.d.ts} +2 -2
  285. package/components/select/{select__filter.js → select-filter.js} +1 -1
  286. package/components/select/select-popup.css +5 -5
  287. package/components/select/{select__popup.d.ts → select-popup.d.ts} +8 -8
  288. package/components/select/{select__popup.js → select-popup.js} +11 -7
  289. package/components/select/select.css +10 -9
  290. package/components/select/select.d.ts +6 -6
  291. package/components/select/select.js +27 -25
  292. package/components/shortcuts/core.js +7 -7
  293. package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
  294. package/components/shortcuts/shortcuts.d.ts +1 -1
  295. package/components/sidebar/sidebar.css +1 -1
  296. package/components/slider/slider.css +2 -2
  297. package/components/slider/slider.d.ts +5 -5
  298. package/components/slider/slider.js +5 -5
  299. package/components/slider/slider.utils.d.ts +1 -1
  300. package/components/slider/slider.utils.js +2 -4
  301. package/components/storage/{storage__local.d.ts → storage-local.d.ts} +1 -1
  302. package/components/storage/{storage__local.js → storage-local.js} +7 -7
  303. package/components/storage/storage.d.ts +1 -1
  304. package/components/storage/storage.js +1 -1
  305. package/components/tab-trap/tab-trap.css +1 -1
  306. package/components/tab-trap/tab-trap.d.ts +1 -1
  307. package/components/tab-trap/tab-trap.js +2 -5
  308. package/components/table/cell.d.ts +1 -1
  309. package/components/table/disable-hover-hoc.d.ts +1 -1
  310. package/components/table/header-cell.d.ts +1 -1
  311. package/components/table/header-cell.js +1 -1
  312. package/components/table/header.d.ts +2 -2
  313. package/components/table/header.js +2 -2
  314. package/components/table/multitable.d.ts +3 -3
  315. package/components/table/multitable.js +1 -1
  316. package/components/table/row-with-focus-sensor.d.ts +3 -3
  317. package/components/table/row.d.ts +4 -4
  318. package/components/table/row.js +1 -1
  319. package/components/table/selection-adapter.d.ts +2 -1
  320. package/components/table/selection-shortcuts-hoc.d.ts +4 -3
  321. package/components/table/selection-shortcuts-hoc.js +1 -3
  322. package/components/table/selection.js +4 -8
  323. package/components/table/simple-table.d.ts +2 -2
  324. package/components/table/smart-table.d.ts +2 -2
  325. package/components/table/table.css +6 -6
  326. package/components/table/table.d.ts +7 -7
  327. package/components/table/table.js +3 -3
  328. package/components/tabs/collapsible-more.d.ts +3 -3
  329. package/components/tabs/collapsible-more.js +2 -2
  330. package/components/tabs/collapsible-tab.d.ts +2 -2
  331. package/components/tabs/collapsible-tab.js +1 -1
  332. package/components/tabs/collapsible-tabs.d.ts +2 -2
  333. package/components/tabs/collapsible-tabs.js +6 -8
  334. package/components/tabs/custom-item.d.ts +2 -2
  335. package/components/tabs/dumb-tabs.d.ts +3 -3
  336. package/components/tabs/dumb-tabs.js +3 -3
  337. package/components/tabs/smart-tabs.d.ts +1 -1
  338. package/components/tabs/tab-link.d.ts +2 -2
  339. package/components/tabs/tab.d.ts +2 -2
  340. package/components/tabs/tabs.css +6 -6
  341. package/components/tag/tag.css +5 -5
  342. package/components/tag/tag.d.ts +2 -2
  343. package/components/tag/tag.js +2 -2
  344. package/components/tags-input/tags-input.css +3 -3
  345. package/components/tags-input/tags-input.d.ts +8 -8
  346. package/components/tags-input/tags-input.js +13 -7
  347. package/components/tags-list/tags-list.d.ts +2 -2
  348. package/components/tags-list/tags-list.js +1 -1
  349. package/components/text/text.css +1 -1
  350. package/components/text/text.d.ts +1 -1
  351. package/components/toggle/toggle.css +2 -2
  352. package/components/toggle/toggle.d.ts +1 -1
  353. package/components/toggle/toggle.js +1 -1
  354. package/components/tooltip/tooltip.css +1 -1
  355. package/components/tooltip/tooltip.d.ts +2 -2
  356. package/components/tooltip/tooltip.js +1 -1
  357. package/components/upload/upload.css +1 -1
  358. package/components/upload/upload.d.ts +3 -3
  359. package/components/upload/upload.js +2 -2
  360. package/components/user-agreement/service.d.ts +2 -2
  361. package/components/user-agreement/service.js +3 -5
  362. package/components/user-agreement/user-agreement.css +2 -2
  363. package/components/user-agreement/user-agreement.d.ts +1 -1
  364. package/components/user-agreement/user-agreement.js +1 -1
  365. package/components/user-card/card.d.ts +1 -1
  366. package/components/user-card/card.js +3 -2
  367. package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
  368. package/components/user-card/smart-user-card-tooltip.js +1 -1
  369. package/components/user-card/tooltip.d.ts +3 -3
  370. package/components/user-card/user-card.css +1 -1
  371. package/package.json +4 -1
  372. /package/components/button/{button__classes.js → button.classes.js} +0 -0
  373. /package/components/dialog/{dialog__body-scroll-preventer.d.ts → dialog-body-scroll-preventer.d.ts} +0 -0
  374. /package/components/global/{variables.d.ts → variables.interface.d.ts} +0 -0
  375. /package/components/global/{variables.js → variables.interface.js} +0 -0
  376. /package/components/hub-source/{hub-source__user.js → hub-source-user.js} +0 -0
  377. /package/components/hub-source/{hub-source__users-groups.js → hub-source-users-groups.js} +0 -0
  378. /package/components/icon/{icon__svg.js → icon-svg.js} +0 -0
  379. /package/components/icon/{icon__constants.d.ts → icon.constants.d.ts} +0 -0
  380. /package/components/icon/{icon__constants.js → icon.constants.js} +0 -0
  381. /package/components/list/{list__classes.js → list.classes.js} +0 -0
  382. /package/components/loader/{loader__core.d.ts → loader-core.d.ts} +0 -0
  383. /package/components/old-browsers-message/{old-browsers-message__stop.d.ts → old-browsers-message-stop.d.ts} +0 -0
  384. /package/components/old-browsers-message/{old-browsers-message__stop.js → old-browsers-message-stop.js} +0 -0
  385. /package/components/permissions/{permissions__cache.d.ts → permissions-cache.d.ts} +0 -0
  386. /package/components/query-assist/{query-assist__suggestions.js → query-assist-suggestions.js} +0 -0
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /* eslint-disable max-lines */
2
3
  import { Component } from 'react';
3
4
  import debounce from 'just-debounce-it';
4
5
  import classNames from 'classnames';
@@ -20,7 +21,7 @@ import { ControlsHeight, ControlsHeightContext } from '../global/controls-height
20
21
  import { Size } from '../input/input';
21
22
  import inputStyles from '../input/input.css';
22
23
  import { I18nContext } from '../i18n/i18n-context';
23
- import QueryAssistSuggestions from './query-assist__suggestions';
24
+ import QueryAssistSuggestions from './query-assist-suggestions';
24
25
  import styles from './query-assist.css';
25
26
  const POPUP_COMPENSATION = PopupMenu.ListProps.Dimension.ITEM_PADDING + PopupMenu.PopupProps.Dimension.BORDER_WIDTH;
26
27
  const ngModelStateField = 'query';
@@ -197,8 +198,9 @@ export default class QueryAssist extends Component {
197
198
  this.setFocus(focusValue);
198
199
  }
199
200
  }
201
+ // eslint-disable-next-line complexity
200
202
  setCaretPosition = (params = {}) => {
201
- const queryLength = this.immediateState.query != null ? this.immediateState.query.length : 0;
203
+ const queryLength = this.immediateState.query ? this.immediateState.query.length : 0;
202
204
  const newCaretPosition = this.immediateState.caret < queryLength ? this.immediateState.caret : queryLength;
203
205
  if (params.fromContentEditable) {
204
206
  this.immediateState.selection = this.immediateState.selection
@@ -226,9 +228,9 @@ export default class QueryAssist extends Component {
226
228
  scrollInput() {
227
229
  const caretOffset = this.caret?.getOffset();
228
230
  if (this.input?.clientWidth !== this.input?.scrollWidth &&
229
- caretOffset != null &&
230
- this.input?.clientWidth != null &&
231
- caretOffset > this.input.clientWidth) {
231
+ caretOffset &&
232
+ this.input?.clientWidth &&
233
+ caretOffset > this.input?.clientWidth) {
232
234
  this.input.scrollLeft += caretOffset;
233
235
  }
234
236
  }
@@ -500,9 +502,7 @@ export default class QueryAssist extends Component {
500
502
  if (caret === 0) {
501
503
  return minOffset;
502
504
  }
503
- else {
504
- offset = caret;
505
- }
505
+ offset = caret;
506
506
  }
507
507
  const result = offset - POPUP_COMPENSATION;
508
508
  return result < minOffset ? minOffset : result;
@@ -674,7 +674,7 @@ export default class QueryAssist extends Component {
674
674
  const actions = [...(this.props.actions || [])];
675
675
  const renderClear = this.props.clear && !!this.state.query;
676
676
  if (renderClear) {
677
- actions.push(_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsx(Button, { icon: closeIcon, className: styles.clear, title: this.props.translations?.clearTitle ?? translate('clearTitle'), ref: this.clearRef, onClick: this.clearQuery, "data-test": "query-assist-clear-icon" })) }, 'clearAction'));
677
+ actions.push(_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsx(Button, { icon: closeIcon, className: styles.clear, title: this.props.translations?.clearTitle ?? translate('clearTitle'), ref: this.clearRef, onClick: this.clearQuery, "data-test": 'query-assist-clear-icon' })) }, 'clearAction'));
678
678
  }
679
679
  return actions;
680
680
  }
@@ -701,10 +701,10 @@ export default class QueryAssist extends Component {
701
701
  [styles.hugePlaceholder]: huge,
702
702
  [styles.withoutGlass]: !glass || (!renderLoader && huge),
703
703
  });
704
- return (_jsx(ControlsHeightContext.Provider, { value: ControlsHeight.M, children: _jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs("div", { "data-test": dataTests('ring-query-assist', dataTest), className: containerClasses, role: "presentation", ref: this.nodeRef, children: [this.state.shortcuts && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), renderGlass && !huge && (_jsx(Icon, { glyph: searchIcon, className: styles.icon, title: translations?.searchTitle ?? translate('searchTitle'), ref: this.glassRef, "data-test": "query-assist-search-icon" })), renderLoader && (_jsx("div", { className: classNames(styles.icon, styles.loader, {
704
+ return (_jsx(ControlsHeightContext.Provider, { value: ControlsHeight.M, children: _jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsxs("div", { "data-test": dataTests('ring-query-assist', dataTest), className: containerClasses, role: 'presentation', ref: this.nodeRef, children: [this.state.shortcuts && _jsx(Shortcuts, { map: this.shortcutsMap, scope: this.shortcutsScope }), renderGlass && !huge && (_jsx(Icon, { glyph: searchIcon, className: styles.icon, title: translations?.searchTitle ?? translate('searchTitle'), ref: this.glassRef, "data-test": 'query-assist-search-icon' })), renderLoader && (_jsx("div", { className: classNames(styles.icon, styles.loader, {
705
705
  [styles.loaderOnTheRight]: !glass && !huge,
706
706
  [styles.loaderActive]: renderLoader,
707
- }), ref: this.loaderRef, children: _jsx(LoaderInline, {}) })), _jsx(ContentEditable, { "aria-label": translations?.searchTitle ?? translate('searchTitle'), className: inputClasses, "data-test": "ring-query-assist-input", inputRef: this.inputRef, disabled: this.props.disabled, onComponentUpdate: () => this.setCaretPosition({ fromContentEditable: true }), onBlur: this.handleFocusChange, onClick: this.handleCaretMove, onCompositionStart: this.trackCompositionState, onCompositionEnd: this.trackCompositionState, onFocus: this.handleFocusChange, onInput: this.handleInput, onKeyUp: this.handleInput, onKeyDown: this.handleEnter, onPaste: this.handlePaste, spellCheck: "false", children: this.state.query && _jsx("span", { children: this.renderQuery() }) }), renderPlaceholder && (_jsx("button", { type: "button", className: placeholderStyles, ref: this.placeholderRef, onClick: this.handleCaretMove, "data-test": "query-assist-placeholder", disabled: this.props.disabled, tabIndex: -1, children: this.props.placeholder })), actions.length ? (_jsx("div", { "data-test": "ring-query-assist-actions", className: styles.actions, children: actions })) : null, _jsx(PopupMenu, { hidden: !this.state.showPopup, onCloseAttempt: this.closePopup, ref: this.popupRef, anchorElement: this.node, keepMounted: true, attached: true, className: this.props.popupClassName, directions: [PopupMenu.PopupProps.Directions.BOTTOM_RIGHT], data: useCustomItemRender ? this.state.suggestions : this.renderSuggestions(), "data-test": "ring-query-assist-popup", hint: this.props.hint, shortcutsMap: this.listShortcutsMap, hintOnSelection: this.props.hintOnSelection, left: this.getPopupOffset(this.state.suggestions), maxHeight: PopupMenu.PopupProps.MaxHeight.SCREEN, onMouseDown: this.trackPopupMouseState, onMouseUp: this.trackPopupMouseState, onSelect: item => this.handleComplete(item) }), glass && huge && (_jsx("div", { className: styles.rightSearchButton, "data-test": "query-assist-search-button", children: _jsx(Icon, { glyph: searchIcon, className: styles.rightSearchIcon, title: translations?.searchTitle ?? translate('searchTitle'), onClick: this.handleApply, ref: this.glassRef, "data-test": "query-assist-search-icon" }) }))] })) }) }));
707
+ }), ref: this.loaderRef, children: _jsx(LoaderInline, {}) })), _jsx(ContentEditable, { "aria-label": translations?.searchTitle ?? translate('searchTitle'), className: inputClasses, "data-test": 'ring-query-assist-input', inputRef: this.inputRef, disabled: this.props.disabled, onComponentUpdate: () => this.setCaretPosition({ fromContentEditable: true }), onBlur: this.handleFocusChange, onClick: this.handleCaretMove, onCompositionStart: this.trackCompositionState, onCompositionEnd: this.trackCompositionState, onFocus: this.handleFocusChange, onInput: this.handleInput, onKeyUp: this.handleInput, onKeyDown: this.handleEnter, onPaste: this.handlePaste, spellCheck: 'false', children: this.state.query && _jsx("span", { children: this.renderQuery() }) }), renderPlaceholder && (_jsx("button", { type: 'button', className: placeholderStyles, ref: this.placeholderRef, onClick: this.handleCaretMove, "data-test": 'query-assist-placeholder', disabled: this.props.disabled, tabIndex: -1, children: this.props.placeholder })), actions.length ? (_jsx("div", { "data-test": 'ring-query-assist-actions', className: styles.actions, children: actions })) : null, _jsx(PopupMenu, { hidden: !this.state.showPopup, onCloseAttempt: this.closePopup, ref: this.popupRef, anchorElement: this.node, keepMounted: true, attached: true, className: this.props.popupClassName, directions: [PopupMenu.PopupProps.Directions.BOTTOM_RIGHT], data: useCustomItemRender ? this.state.suggestions : this.renderSuggestions(), "data-test": 'ring-query-assist-popup', hint: this.props.hint, shortcutsMap: this.listShortcutsMap, hintOnSelection: this.props.hintOnSelection, left: this.getPopupOffset(this.state.suggestions), maxHeight: PopupMenu.PopupProps.MaxHeight.SCREEN, onMouseDown: this.trackPopupMouseState, onMouseUp: this.trackPopupMouseState, onSelect: item => this.handleComplete(item) }), glass && huge && (_jsx("div", { className: styles.rightSearchButton, "data-test": 'query-assist-search-button', children: _jsx(Icon, { glyph: searchIcon, className: styles.rightSearchIcon, title: translations?.searchTitle ?? translate('searchTitle'), onClick: this.handleApply, ref: this.glassRef, "data-test": 'query-assist-search-icon' }) }))] })) }) }));
708
708
  }
709
709
  }
710
710
  export const RerenderableQueryAssist = rerenderHOC(QueryAssist);
@@ -1,4 +1,4 @@
1
- import { Component, InputHTMLAttributes, ReactNode } from 'react';
1
+ import { Component, type InputHTMLAttributes, type ReactNode } from 'react';
2
2
  export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
3
3
  value?: string | undefined;
4
4
  onChange?: ((value: string) => void) | null | undefined;
@@ -18,10 +18,10 @@ export class RadioItemInner extends Component {
18
18
  render() {
19
19
  const { className, children, help, ...restProps } = this.props;
20
20
  const classes = classNames(styles.radio, className);
21
- return (_jsxs("label", { ref: this.labelRef, className: classes, htmlFor: this.uid, children: [_jsx("input", { id: this.uid, ...restProps, ref: this.inputRef, className: styles.input, type: "radio" }), _jsx("span", { className: styles.circle }), _jsxs("span", { className: styles.label, children: [children, help && _jsx(ControlHelp, { children: help })] })] }));
21
+ return (_jsxs("label", { ref: this.labelRef, className: classes, htmlFor: this.uid, children: [_jsx("input", { id: this.uid, ...restProps, ref: this.inputRef, className: styles.input, type: 'radio' }), _jsx("span", { className: styles.circle }), _jsxs("span", { className: styles.label, children: [children, help && _jsx(ControlHelp, { children: help })] })] }));
22
22
  }
23
23
  }
24
24
  const RadioItem = forwardRef(function RadioItem(props, ref) {
25
- return (_jsx(RadioContext.Consumer, { children: ({ value, onChange, ...restContext }) => (_jsx(RadioItemInner, { ref: ref, ...restContext, checked: value != null ? value === props.value : undefined, onChange: onChange != null ? () => onChange(props.value) : undefined, ...props })) }));
25
+ return (_jsx(RadioContext.Consumer, { children: ({ value, onChange, ...restContext }) => (_jsx(RadioItemInner, { ref: ref, ...restContext, checked: value ? value === props.value : undefined, onChange: onChange ? () => onChange(props.value) : undefined, ...props })) }));
26
26
  });
27
27
  export default RadioItem;
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .radio {
4
4
  position: relative;
@@ -48,7 +48,7 @@
48
48
  width: var(--ring-unit);
49
49
  height: var(--ring-unit);
50
50
 
51
- content: "";
51
+ content: '';
52
52
 
53
53
  transition:
54
54
  opacity var(--ring-fast-ease),
@@ -1,10 +1,10 @@
1
1
  import { Component } from 'react';
2
- import { RadioProps } from './radio__item';
2
+ import { type RadioProps } from './radio-item';
3
3
  /**
4
4
  * @name Radio
5
5
  */
6
6
  export default class Radio extends Component<RadioProps> {
7
- static Item: import("react").ForwardRefExoticComponent<import("./radio__item").RadioItemProps & import("react").RefAttributes<import("./radio__item").RadioItemInner>>;
7
+ static Item: import("react").ForwardRefExoticComponent<import("./radio-item").RadioItemProps & import("react").RefAttributes<import("./radio-item").RadioItemInner>>;
8
8
  uid: string;
9
9
  render(): import("react/jsx-runtime").JSX.Element;
10
10
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Component } from 'react';
3
3
  import getUID from '../global/get-uid';
4
- import RadioItem, { RadioContext } from './radio__item';
4
+ import RadioItem, { RadioContext } from './radio-item';
5
5
  /**
6
6
  * @name Radio
7
7
  */
@@ -1,2 +1,2 @@
1
- import { HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes } from 'react';
2
2
  export default function ScrollableSection({ className, ...restProps }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -9,7 +9,7 @@ export default function ScrollableSection({ className, ...restProps }) {
9
9
  const [scrolledToLeft, setScrolledToLeft] = useState(false);
10
10
  const ref = useRef(null);
11
11
  const calculateScrollPosition = useCallback(() => {
12
- if (ref.current != null) {
12
+ if (ref.current) {
13
13
  const { scrollTop, scrollLeft, scrollHeight, scrollWidth, offsetHeight, offsetWidth } = ref.current;
14
14
  setScrolledToTop(scrollTop === 0);
15
15
  setScrolledToRight(offsetWidth + scrollLeft >= scrollWidth);
@@ -1,5 +1,5 @@
1
- import { Component, RefCallback } from 'react';
2
- import { InputAttrs } from '../input/input';
1
+ import { Component, type RefCallback } from 'react';
2
+ import { type InputAttrs } from '../input/input';
3
3
  declare function noop(): void;
4
4
  type SelectFilterProps = InputAttrs & {
5
5
  inputRef: RefCallback<HTMLInputElement | HTMLTextAreaElement>;
@@ -35,6 +35,6 @@ export default class SelectFilter extends Component {
35
35
  render() {
36
36
  const { className, listId, ...restProps } = this.props;
37
37
  const classes = classNames(styles.filter, className);
38
- return (_jsx(ActiveItemContext.ValueContext.Consumer, { children: activeItemId => (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsx(Input, { ...restProps, placeholder: restProps.placeholder ?? translate('filterItems'), "aria-owns": listId, "aria-activedescendant": activeItemId, autoComplete: "off", autoFocus: true, borderless: true, inputRef: this.inputRef, className: classes })) })) }));
38
+ return (_jsx(ActiveItemContext.ValueContext.Consumer, { children: activeItemId => (_jsx(I18nContext.Consumer, { children: ({ translate }) => (_jsx(Input, { ...restProps, placeholder: restProps.placeholder ?? translate('filterItems'), "aria-owns": listId, "aria-activedescendant": activeItemId, autoComplete: 'off', autoFocus: true, borderless: true, inputRef: this.inputRef, className: classes })) })) }));
39
39
  }
40
40
  }
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .filterWithTags {
4
4
  overflow: hidden;
@@ -15,7 +15,7 @@
15
15
  padding-right: 0;
16
16
  padding-left: 0;
17
17
 
18
- border-bottom: none;
18
+ border-bottom: 0;
19
19
  }
20
20
 
21
21
  &:hover {
@@ -31,7 +31,7 @@
31
31
  .filterWithTagsInput {
32
32
  padding: 0;
33
33
 
34
- border: none;
34
+ border: 0;
35
35
  }
36
36
 
37
37
  .filter {
@@ -55,7 +55,7 @@
55
55
 
56
56
  border-bottom: 1px solid var(--ring-borders-color);
57
57
 
58
- [dir="rtl"] & {
58
+ [dir='rtl'] & {
59
59
  padding-right: calc(var(--ring-unit) * 5.5);
60
60
  padding-left: var(--ring-unit);
61
61
  }
@@ -68,7 +68,7 @@
68
68
 
69
69
  color: var(--ring-secondary-color);
70
70
 
71
- [dir="rtl"] & {
71
+ [dir='rtl'] & {
72
72
  right: calc(var(--ring-unit) * 2);
73
73
  left: auto;
74
74
  }
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @description Displays a popup with select's options.
3
3
  */
4
- import { ComponentType, CSSProperties, PureComponent, ReactNode, Ref, SyntheticEvent } from 'react';
4
+ import { type ComponentType, type CSSProperties, PureComponent, type ReactNode, type Ref, type SyntheticEvent } from 'react';
5
5
  import * as React from 'react';
6
- import { IconType } from '../icon/icon';
6
+ import { type IconType } from '../icon/icon';
7
7
  import Popup from '../popup/popup';
8
- import { Directions } from '../popup/position';
9
- import List, { SelectHandlerParams } from '../list/list';
8
+ import { type Directions } from '../popup/position';
9
+ import List, { type SelectHandlerParams } from '../list/list';
10
10
  import Caret from '../caret/caret';
11
- import { ListDataItem } from '../list/consts';
12
- import { ShortcutsMap } from '../shortcuts/core';
13
- import { TagAttrs } from '../tag/tag';
14
- import { SelectItem } from './select';
11
+ import { type ListDataItem } from '../list/consts';
12
+ import { type ShortcutsMap } from '../shortcuts/core';
13
+ import { type TagAttrs } from '../tag/tag';
14
+ import { type SelectItem } from './select';
15
15
  export type FilterFn<T> = (itemToCheck: SelectItem<T>, checkString: string, data: readonly SelectItem<T>[]) => boolean;
16
16
  export interface Filter<T = unknown> {
17
17
  fn?: FilterFn<T> | null | undefined;
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /* eslint-disable max-lines */
2
3
  /**
3
4
  * @description Displays a popup with select's options.
4
5
  */
5
- import { PureComponent } from 'react';
6
+ import { PureComponent, } from 'react';
6
7
  import classNames from 'classnames';
7
8
  import searchIcon from '@jetbrains/icons/search';
8
9
  import memoizeOne from 'memoize-one';
@@ -22,9 +23,9 @@ import Shortcuts from '../shortcuts/shortcuts';
22
23
  import Button from '../button/button';
23
24
  import Text from '../text/text';
24
25
  import { ControlsHeight } from '../global/controls-height';
25
- import { createComposedRef } from '../global/composeRefs';
26
+ import { createComposedRef } from '../global/compose-refs';
26
27
  import { DEFAULT_DIRECTIONS } from '../popup/popup.consts';
27
- import SelectFilter from './select__filter';
28
+ import SelectFilter from './select-filter';
28
29
  import styles from './select-popup.css';
29
30
  const FILTER_HEIGHT = 35;
30
31
  const TOOLBAR_HEIGHT = 49;
@@ -80,7 +81,7 @@ export default class SelectPopup extends PureComponent {
80
81
  }
81
82
  caret;
82
83
  handleNavigation(event, navigateLeft) {
83
- if ((this.isEventTargetFilter(event) && this.caret != null && Number(this.caret.getPosition()) > 0) ||
84
+ if ((this.isEventTargetFilter(event) && this.caret && Number(this.caret?.getPosition()) > 0) ||
84
85
  !Array.isArray(this.props.selected)) {
85
86
  return;
86
87
  }
@@ -103,6 +104,7 @@ export default class SelectPopup extends PureComponent {
103
104
  if (!Array.isArray(this.props.selected)) {
104
105
  return;
105
106
  }
107
+ // eslint-disable-next-line no-underscore-dangle
106
108
  const _tag = tag || this.props.selected.slice(0)[this.props.selected.length - 1];
107
109
  if (_tag) {
108
110
  this.onListSelect(_tag, event, { tryKeepOpen: true });
@@ -113,7 +115,9 @@ export default class SelectPopup extends PureComponent {
113
115
  }
114
116
  }
115
117
  removeSelectedTag() {
116
- if (Array.isArray(this.props.selected) && this.state.tagsActiveIndex != null) {
118
+ if (Array.isArray(this.props.selected) &&
119
+ this.state.tagsActiveIndex !== null &&
120
+ this.state.tagsActiveIndex !== undefined) {
117
121
  this.removeTag(this.props.selected[this.state.tagsActiveIndex]);
118
122
  return false;
119
123
  }
@@ -179,7 +183,7 @@ export default class SelectPopup extends PureComponent {
179
183
  onClickHandler = () => this.filter?.focus();
180
184
  getFilter() {
181
185
  if (this.props.filter || this.props.tags) {
182
- return (_jsxs("div", { className: styles.filterWrapper, "data-test": "ring-select-popup-filter", children: [!this.props.tags && (_jsx(Icon, { glyph: this.props.filterIcon ?? searchIcon, className: styles.filterIcon, "data-test-custom": "ring-select-popup-filter-icon" })), _jsx(FilterWithShortcuts, { rgShortcutsOptions: this.state.popupFilterShortcutsOptions, rgShortcutsMap: this.popupFilterShortcutsMap, value: this.props.filterValue, inputRef: this.composedFilterRef(this.filterRef, this.props.filterRef), onBlur: this.popupFilterOnBlur, onFocus: this.onFilterFocus, className: "ring-js-shortcuts", inputClassName: classNames({ [styles.filterWithTagsInput]: this.props.tags }), placeholder: typeof this.props.filter === 'object' ? this.props.filter.placeholder : undefined, height: this.props.tags ? ControlsHeight.S : ControlsHeight.L, onChange: this.props.onFilter, onClick: this.onClickHandler, onClear: this.props.tags ? undefined : this.props.onClear, "data-test-custom": "ring-select-popup-filter-input", listId: this.props.listId, enableShortcuts: Object.keys(this.popupFilterShortcutsMap) })] }));
186
+ return (_jsxs("div", { className: styles.filterWrapper, "data-test": 'ring-select-popup-filter', children: [!this.props.tags && (_jsx(Icon, { glyph: this.props.filterIcon ?? searchIcon, className: styles.filterIcon, "data-test-custom": 'ring-select-popup-filter-icon' })), _jsx(FilterWithShortcuts, { rgShortcutsOptions: this.state.popupFilterShortcutsOptions, rgShortcutsMap: this.popupFilterShortcutsMap, value: this.props.filterValue, inputRef: this.composedFilterRef(this.filterRef, this.props.filterRef), onBlur: this.popupFilterOnBlur, onFocus: this.onFilterFocus, className: 'ring-js-shortcuts', inputClassName: classNames({ [styles.filterWithTagsInput]: this.props.tags }), placeholder: typeof this.props.filter === 'object' ? this.props.filter.placeholder : undefined, height: this.props.tags ? ControlsHeight.S : ControlsHeight.L, onChange: this.props.onFilter, onClick: this.onClickHandler, onClear: this.props.tags ? undefined : this.props.onClear, "data-test-custom": 'ring-select-popup-filter-input', listId: this.props.listId, enableShortcuts: Object.keys(this.popupFilterShortcutsMap) })] }));
183
187
  }
184
188
  return null;
185
189
  }
@@ -268,7 +272,7 @@ export default class SelectPopup extends PureComponent {
268
272
  // render the list would be a better way
269
273
  const anchorNode = this.props.anchorElement;
270
274
  const containerNode = getPopupContainer(ringPopupTarget) || document.documentElement;
271
- return anchorNode != null
275
+ return anchorNode !== null
272
276
  ? Math.min(directions.reduce((maxHeight, direction) => Math.max(maxHeight, maxHeightForDirection(direction, anchorNode, getStyles(containerNode).position !== 'static' ? containerNode : null) ?? 0), minMaxHeight), userDefinedMaxHeight)
273
277
  : userDefinedMaxHeight;
274
278
  });
@@ -1,4 +1,4 @@
1
- @import "../global/variables.css";
1
+ @import '../global/variables.css';
2
2
 
3
3
  .select {
4
4
  position: relative;
@@ -20,7 +20,7 @@
20
20
 
21
21
  text-align: left;
22
22
 
23
- [dir="rtl"] & {
23
+ [dir='rtl'] & {
24
24
  text-align: right;
25
25
  direction: ltr;
26
26
  }
@@ -63,7 +63,7 @@
63
63
  }
64
64
 
65
65
  .selectedIcon {
66
- composes: resetButton from "../global/global.css";
66
+ composes: resetButton from '../global/global.css';
67
67
 
68
68
  position: relative;
69
69
  top: 3px;
@@ -112,8 +112,8 @@
112
112
  }
113
113
 
114
114
  .value {
115
- composes: ellipsis from "../global/global.css";
116
- composes: font from "../global/global.css";
115
+ composes: ellipsis from '../global/global.css';
116
+ composes: font from '../global/global.css';
117
117
 
118
118
  display: inline-block;
119
119
 
@@ -131,7 +131,7 @@
131
131
 
132
132
  color: var(--ring-text-color);
133
133
 
134
- border: none;
134
+ border: 0;
135
135
  border-bottom: 1px solid var(--ring-borders-color);
136
136
  outline: none;
137
137
  background: transparent;
@@ -160,7 +160,7 @@
160
160
  }
161
161
 
162
162
  .buttonValue {
163
- composes: ellipsis from "../global/global.css";
163
+ composes: ellipsis from '../global/global.css';
164
164
 
165
165
  display: block;
166
166
 
@@ -180,7 +180,7 @@
180
180
  }
181
181
 
182
182
  .buttonValueEmpty.buttonValueEmpty {
183
- color: var(--ring-disabled-color);
183
+ color: var(--ring-secondary-color);
184
184
  }
185
185
 
186
186
  .heightS .buttonValue {
@@ -211,7 +211,8 @@
211
211
 
212
212
  color: var(--ring-disabled-color);
213
213
 
214
- & .value {
214
+ & .value,
215
+ & .buttonValueEmpty {
215
216
  color: var(--ring-disabled-color);
216
217
  border-bottom-style: dashed;
217
218
  }
@@ -1,12 +1,12 @@
1
- import { ButtonHTMLAttributes, Component, ComponentType, CSSProperties, HTMLAttributes, ReactNode, Ref, RefCallback, SyntheticEvent } from 'react';
1
+ import { type ButtonHTMLAttributes, Component, type ComponentType, type CSSProperties, type HTMLAttributes, type ReactNode, type Ref, type RefCallback, type SyntheticEvent } from 'react';
2
2
  import * as React from 'react';
3
- import { SelectHandlerParams } from '../list/list';
3
+ import { type SelectHandlerParams } from '../list/list';
4
4
  import { Size } from '../input/input';
5
- import { LabelType } from '../control-label/control-label';
6
- import { ListDataItem } from '../list/consts';
7
- import { Directions } from '../popup/popup.consts';
5
+ import { type LabelType } from '../control-label/control-label';
6
+ import { type ListDataItem } from '../list/consts';
7
+ import { type Directions } from '../popup/popup.consts';
8
8
  import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
9
- import SelectPopup, { Filter, FilterFn, Multiple, Tags } from './select__popup';
9
+ import SelectPopup, { type Filter, type FilterFn, type Multiple, type Tags } from './select-popup';
10
10
  /**
11
11
  * @name Select
12
12
  */
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /* eslint-disable max-lines */
2
3
  import { Component, Fragment, } from 'react';
3
4
  import classNames from 'classnames';
4
5
  import chevronDownIcon from '@jetbrains/icons/chevron-down';
@@ -18,11 +19,11 @@ import rerenderHOC from '../global/rerender-hoc';
18
19
  import fuzzyHighlight from '../global/fuzzy-highlight';
19
20
  import memoize from '../global/memoize';
20
21
  import { I18nContext } from '../i18n/i18n-context';
21
- import { createComposedRef } from '../global/composeRefs';
22
+ import { createComposedRef } from '../global/compose-refs';
22
23
  import { isArray } from '../global/typescript-utils';
23
24
  import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
24
25
  import inputStyles from '../input/input.css';
25
- import SelectPopup from './select__popup';
26
+ import SelectPopup from './select-popup';
26
27
  import styles from './select.css';
27
28
  /**
28
29
  * @name Select
@@ -55,7 +56,7 @@ function getLowerCaseLabel(item) {
55
56
  }
56
57
  function doesLabelMatch(itemToCheck, fn) {
57
58
  const lowerCaseLabel = getLowerCaseLabel(itemToCheck);
58
- if (lowerCaseLabel == null) {
59
+ if (lowerCaseLabel === null || lowerCaseLabel === undefined) {
59
60
  return true;
60
61
  }
61
62
  return fn(lowerCaseLabel);
@@ -77,6 +78,7 @@ function buildMultipleMap(selected) {
77
78
  return acc;
78
79
  }, {});
79
80
  }
81
+ // eslint-disable-next-line complexity
80
82
  function getListItems(props, state, rawFilterString, data = props.data) {
81
83
  let filterString = rawFilterString.trim();
82
84
  if (isInputMode(props.type) &&
@@ -136,7 +138,7 @@ function getListItems(props, state, rawFilterString, data = props.data) {
136
138
  return { filteredData, addButton };
137
139
  }
138
140
  const getItemLabel = ({ selectedLabel, label }) => {
139
- if (selectedLabel != null) {
141
+ if (selectedLabel !== null && selectedLabel !== undefined) {
140
142
  return selectedLabel;
141
143
  }
142
144
  return typeof label === 'string' ? label : '';
@@ -236,7 +238,9 @@ export default class Select extends Component {
236
238
  const { filteredData, addButton } = getListItems(nextProps, nextState, filterValue, data);
237
239
  Object.assign(nextState, { shownData: filteredData, addButton });
238
240
  }
239
- const isSelectionEmpty = nextProps.selected == null || (Array.isArray(nextProps.selected) && nextProps.selected.length === 0);
241
+ const isSelectionEmpty = nextProps.selected === null ||
242
+ nextProps.selected === undefined ||
243
+ (Array.isArray(nextProps.selected) && nextProps.selected.length === 0);
240
244
  if (isSelectionEmpty) {
241
245
  nextState.lastInteractedKey = null;
242
246
  }
@@ -333,7 +337,7 @@ export default class Select extends Component {
333
337
  if (!this._popup?.isVisible()) {
334
338
  return true;
335
339
  }
336
- else if (this.props.multiple || !this.props.getInitial) {
340
+ if (this.props.multiple || !this.props.getInitial) {
337
341
  return false;
338
342
  }
339
343
  const selected = {
@@ -360,7 +364,7 @@ export default class Select extends Component {
360
364
  _getActiveIndex(items) {
361
365
  const { selected, lastInteractedKey } = this.state;
362
366
  const isNonOptionItem = (item) => item.isResetItem || List.isItemType(List.ListProps.Type.SEPARATOR, item);
363
- if (lastInteractedKey != null) {
367
+ if (lastInteractedKey !== null && lastInteractedKey !== undefined) {
364
368
  const index = items.findIndex(item => item.key === lastInteractedKey && !isNonOptionItem(item));
365
369
  if (index >= 0)
366
370
  return index;
@@ -404,7 +408,7 @@ export default class Select extends Component {
404
408
  separator: reset.separator,
405
409
  key: reset.label,
406
410
  rgItemType: List.ListProps.Type.CUSTOM,
407
- template: (_jsx(Button, { inline: true, className: styles.button, "data-test": "ring-select-reset-tags-button", height: ControlsHeight.S, children: reset.label })),
411
+ template: (_jsx(Button, { inline: true, className: styles.button, "data-test": 'ring-select-reset-tags-button', height: ControlsHeight.S, children: reset.label })),
408
412
  glyph: reset.glyph,
409
413
  onClick: resetHandler,
410
414
  };
@@ -425,6 +429,7 @@ export default class Select extends Component {
425
429
  _renderPopup() {
426
430
  const anchorElement = this.props.targetElement || this.node;
427
431
  const { showPopup, shownData } = this.state;
432
+ // eslint-disable-next-line no-underscore-dangle
428
433
  const _shownData = this._prependResetOption(shownData);
429
434
  const activeIndex = this._getActiveIndex(_shownData);
430
435
  return (_jsx(I18nContext.Consumer, { children: ({ translate }) => {
@@ -474,7 +479,7 @@ export default class Select extends Component {
474
479
  }
475
480
  return (_jsxs("div", { className: classNames({
476
481
  [styles.toolbar]: Boolean(this.state.addButton || renderBottomToolbar),
477
- }), "data-test": "ring-select-toolbar", children: [renderBottomToolbar && renderBottomToolbar(), this.state.addButton && (_jsx(Button, { inline: true, delayed: delayed, className: classNames(styles.button, styles.buttonSpaced), onClick: this.addHandler, "data-test": "ring-select-toolbar-button", children: prefix ? `${prefix} ${label}` : label })), hint && _jsx(List.ListHint, { label: hint, "data-test": "ring-select-toolbar-hint" })] }));
482
+ }), "data-test": 'ring-select-toolbar', children: [renderBottomToolbar && renderBottomToolbar(), this.state.addButton && (_jsx(Button, { inline: true, delayed: delayed, className: classNames(styles.button, styles.buttonSpaced), onClick: this.addHandler, "data-test": 'ring-select-toolbar-button', children: prefix ? `${prefix} ${label}` : label })), hint && _jsx(List.ListHint, { label: hint, "data-test": 'ring-select-toolbar-hint' })] }));
478
483
  }
479
484
  getTopbar() {
480
485
  return this.props.renderTopToolbar?.();
@@ -494,9 +499,7 @@ export default class Select extends Component {
494
499
  this.setState({ filterValue: setValue });
495
500
  return undefined;
496
501
  }
497
- else {
498
- return this.state.filterValue;
499
- }
502
+ return this.state.filterValue;
500
503
  }
501
504
  isInputMode() {
502
505
  return isInputMode(this.props.type);
@@ -597,7 +600,7 @@ export default class Select extends Component {
597
600
  if (!tryKeepOpen) {
598
601
  this._hidePopup(isSelectItemEvent);
599
602
  }
600
- if (selected.key == null) {
603
+ if (selected.key === null || selected.key === undefined) {
601
604
  throw new Error('Multiple selection requires each item to have the "key" property');
602
605
  }
603
606
  this.setState(prevState => {
@@ -729,9 +732,7 @@ export default class Select extends Component {
729
732
  }
730
733
  return labels.filter(Boolean).join(', ');
731
734
  }
732
- else {
733
- return this.state.selected != null ? getItemLabel(this.state.selected) : null;
734
- }
735
+ return this.state.selected !== null && this.state.selected !== undefined ? getItemLabel(this.state.selected) : null;
735
736
  }
736
737
  getHeight() {
737
738
  return this.props.height || (typeof this.context === 'function' ? this.context() : this.context);
@@ -742,13 +743,13 @@ export default class Select extends Component {
742
743
  const icons = [];
743
744
  const height = this.getHeight();
744
745
  if (!Array.isArray(selected) && selected?.icon) {
745
- icons.push(_jsx("button", { title: "Toggle options popup", type: "button", className: styles.selectedIcon, disabled: this.props.disabled, onClick: this._clickHandler, style: { backgroundImage: `url(${selected.icon})` } }, "selected"));
746
+ icons.push(_jsx("button", { title: 'Toggle options popup', type: 'button', className: styles.selectedIcon, disabled: this.props.disabled, onClick: this._clickHandler, style: { backgroundImage: `url(${selected.icon})` } }, 'selected'));
746
747
  }
747
748
  if (clear && !disabled && !this._selectionIsEmpty()) {
748
- icons.push(_jsx(Button, { title: "Clear selection", "data-test": "ring-clear-select", className: styles.clearIcon, disabled: this.props.disabled, onClick: this.clear, height: height, icon: closeIcon }, "close"));
749
+ icons.push(_jsx(Button, { title: 'Clear selection', "data-test": 'ring-clear-select', className: styles.clearIcon, disabled: this.props.disabled, onClick: this.clear, height: height, icon: closeIcon }, 'close'));
749
750
  }
750
751
  if (!hideArrow) {
751
- icons.push(_jsx(Button, { title: "Toggle options popup", className: styles.chevron, iconClassName: styles.chevronIcon, icon: chevronDownIcon, disabled: this.props.disabled, height: height, onClick: this._clickHandler }, "hide"));
752
+ icons.push(_jsx(Button, { title: 'Toggle options popup', className: styles.chevron, iconClassName: styles.chevronIcon, icon: chevronDownIcon, disabled: this.props.disabled, height: height, onClick: this._clickHandler }, 'hide'));
752
753
  }
753
754
  return icons;
754
755
  }
@@ -774,6 +775,7 @@ export default class Select extends Component {
774
775
  space: noop,
775
776
  };
776
777
  }
778
+ // eslint-disable-next-line complexity
777
779
  renderSelect(activeItemId) {
778
780
  const dataTest = this.props['data-test'];
779
781
  const { selectedLabel } = this.props;
@@ -799,10 +801,10 @@ export default class Select extends Component {
799
801
  switch (this.props.type) {
800
802
  case Type.INPUT_WITHOUT_CONTROLS:
801
803
  case Type.INPUT:
802
- return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: this.nodeRef, className: classNames(classes, styles.inputMode), "data-test": dataTests('ring-select', dataTest), role: "presentation" // has interactive elements inside
803
- , onMouseDown: this.mouseDownHandler, onMouseUp: this.mouseUpHandler, children: [shortcutsEnabled && _jsx(Shortcuts, { map: this.getShortcutsMap(), scope: this.shortcutsScope }), _jsx(Input, { ...ariaProps, height: this.props.height, autoComplete: "off", id: this.props.id, onClick: this._clickHandler, inputRef: this.composedFilterRef(this.filterRef, this.props.filterRef), disabled: this.props.disabled, value: this.state.filterValue, borderless: this.props.type === Type.INPUT_WITHOUT_CONTROLS, style: style, size: Size.FULL, onChange: this._filterChangeHandler, onFocus: this._focusHandler, onBlur: this._blurHandler,
804
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: this.nodeRef, className: classNames(classes, styles.inputMode), "data-test": dataTests('ring-select', dataTest), role: 'presentation' // has interactive elements inside
805
+ , onMouseDown: this.mouseDownHandler, onMouseUp: this.mouseUpHandler, children: [shortcutsEnabled && _jsx(Shortcuts, { map: this.getShortcutsMap(), scope: this.shortcutsScope }), _jsx(Input, { ...ariaProps, height: this.props.height, autoComplete: 'off', id: this.props.id, onClick: this._clickHandler, inputRef: this.composedFilterRef(this.filterRef, this.props.filterRef), disabled: this.props.disabled, value: this.state.filterValue, borderless: this.props.type === Type.INPUT_WITHOUT_CONTROLS, style: style, size: Size.FULL, onChange: this._filterChangeHandler, onFocus: this._focusHandler, onBlur: this._blurHandler,
804
806
  // Input with error style without description
805
- error: this.props.error != null ? '' : null, label: this.props.type === Type.INPUT ? this._getLabel() : null, placeholder: this.props.inputPlaceholder, onKeyDown: this.props.onKeyDown, "data-test": "ring-select__focus", enableShortcuts: shortcutsEnabled
807
+ error: this.props.error ? '' : null, label: this.props.type === Type.INPUT ? this._getLabel() : null, placeholder: this.props.inputPlaceholder, onKeyDown: this.props.onKeyDown, "data-test": 'ring-select__focus', enableShortcuts: shortcutsEnabled
806
808
  ? Object.keys({
807
809
  ...this.getShortcutsMap(),
808
810
  ...this._popup?.list?.shortcutsMap,
@@ -812,9 +814,9 @@ export default class Select extends Component {
812
814
  return (_jsxs("div", { ref: this.nodeRef, className: classNames(classes, styles.buttonMode), "data-test": dataTests('ring-select', dataTest), children: [selectedLabel && (_jsx(ControlLabel, { type: this.props.labelType, disabled: this.props.disabled, htmlFor: this.props.id, children: selectedLabel })), shortcutsEnabled && _jsx(Shortcuts, { map: this.getShortcutsMap(), scope: this.shortcutsScope }), _jsxs("div", { className: styles.buttonContainer, children: [_jsxs(Button, { ...ariaProps, height: this.props.height, id: this.props.id, onClick: this._clickHandler, className: classNames(this.props.buttonClassName, styles.buttonValue, {
813
815
  [styles.buttonValueOpen]: this.state.showPopup,
814
816
  [styles.buttonValueEmpty]: this._selectionIsEmpty(),
815
- }), disabled: this.props.disabled, style: style, "data-test": "ring-select__button ring-select__focus", children: [this._getAvatar(), this._getPlaceholder()] }), iconsNode] }), this._renderPopup()] }));
817
+ }), disabled: this.props.disabled, style: style, "data-test": 'ring-select__button ring-select__focus', children: [this._getAvatar(), this._getPlaceholder()] }), iconsNode] }), this._renderPopup()] }));
816
818
  case Type.INLINE:
817
- return (_jsxs("div", { className: classes, ref: this.nodeRef, "data-test": dataTests('ring-select', dataTest), children: [shortcutsEnabled && _jsx(Shortcuts, { map: this.getShortcutsMap(), scope: this.shortcutsScope }), _jsx(Anchor, { ...ariaProps, className: this.props.buttonClassName ?? undefined, id: this.props.id, onClick: this._clickHandler, "data-test": "ring-select__focus", disabled: this.props.disabled, active: this.state.showPopup, children: this._getPlaceholder() }), this._renderPopup()] }));
819
+ return (_jsxs("div", { className: classes, ref: this.nodeRef, "data-test": dataTests('ring-select', dataTest), children: [shortcutsEnabled && _jsx(Shortcuts, { map: this.getShortcutsMap(), scope: this.shortcutsScope }), _jsx(Anchor, { ...ariaProps, className: this.props.buttonClassName ?? undefined, id: this.props.id, onClick: this._clickHandler, "data-test": 'ring-select__focus', disabled: this.props.disabled, active: this.state.showPopup, children: this._getPlaceholder() }), this._renderPopup()] }));
818
820
  default:
819
821
  if (this.props.customAnchor) {
820
822
  return (_jsxs(Fragment, { children: [shortcutsEnabled && _jsx(Shortcuts, { map: this.getShortcutsMap(), scope: this.shortcutsScope }), this.props.customAnchor({
@@ -833,7 +835,7 @@ export default class Select extends Component {
833
835
  popup: this._renderPopup(),
834
836
  })] }));
835
837
  }
836
- return (_jsx("span", { id: this.props.id, ref: this.nodeRef, "data-test": "ring-select", children: this._renderPopup() }));
838
+ return (_jsx("span", { id: this.props.id, ref: this.nodeRef, "data-test": 'ring-select', children: this._renderPopup() }));
837
839
  }
838
840
  }
839
841
  render() {