@gravity-ui/querieskit 1.1.0 → 1.2.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 (367) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/cjs/components/EditableRowTitle/EditableRowTitle.d.ts +7 -0
  3. package/build/cjs/{modules/HistoryRow/HistoryRowTitle.js → components/EditableRowTitle/EditableRowTitle.js} +4 -6
  4. package/build/cjs/components/EditableRowTitle/EditableRowTitle.js.map +1 -0
  5. package/build/cjs/components/EditableRowTitle/index.d.ts +2 -0
  6. package/build/cjs/components/EditableRowTitle/index.js +13 -0
  7. package/build/cjs/components/EditableRowTitle/index.js.map +1 -0
  8. package/build/cjs/components/HistoryFilter/HistoryFilter.d.ts +2 -2
  9. package/build/cjs/components/HistoryFilter/HistoryFilter.js.map +1 -1
  10. package/build/cjs/components/LazyList/LazyList.css +0 -2
  11. package/build/cjs/components/LazyList/LazyList.css.map +1 -1
  12. package/build/cjs/components/RowActionsMenu/RowActionsMenu.d.ts +7 -0
  13. package/build/cjs/{modules/HistoryRow/HistoryRowMenu.js → components/RowActionsMenu/RowActionsMenu.js} +9 -6
  14. package/build/cjs/components/RowActionsMenu/RowActionsMenu.js.map +1 -0
  15. package/build/cjs/components/RowActionsMenu/index.d.ts +2 -0
  16. package/build/cjs/components/RowActionsMenu/index.js +13 -0
  17. package/build/cjs/components/RowActionsMenu/index.js.map +1 -0
  18. package/build/cjs/components/index.d.ts +4 -0
  19. package/build/cjs/components/index.js +16 -0
  20. package/build/cjs/components/index.js.map +1 -1
  21. package/build/cjs/helpers/getListKey.d.ts +2 -2
  22. package/build/cjs/helpers/getListKey.js.map +1 -1
  23. package/build/cjs/helpers/isFieldVisible.d.ts +5 -4
  24. package/build/cjs/helpers/isFieldVisible.js +2 -2
  25. package/build/cjs/helpers/isFieldVisible.js.map +1 -1
  26. package/build/cjs/helpers/time.d.ts +1 -0
  27. package/build/cjs/helpers/time.js +7 -3
  28. package/build/cjs/helpers/time.js.map +1 -1
  29. package/build/cjs/index.d.ts +2 -0
  30. package/build/cjs/index.js +11 -0
  31. package/build/cjs/index.js.map +1 -1
  32. package/build/cjs/modules/HistoryComparisonActions/HistoryComparisonActions.css +5 -0
  33. package/build/cjs/modules/HistoryComparisonActions/HistoryComparisonActions.css.map +1 -0
  34. package/build/cjs/modules/HistoryComparisonActions/HistoryComparisonActions.d.ts +8 -0
  35. package/build/cjs/{widgets/QueriesHistory/ComparisonActions.js → modules/HistoryComparisonActions/HistoryComparisonActions.js} +11 -11
  36. package/build/cjs/modules/HistoryComparisonActions/HistoryComparisonActions.js.map +1 -0
  37. package/build/cjs/modules/HistoryComparisonActions/index.d.ts +2 -0
  38. package/build/cjs/modules/HistoryComparisonActions/index.js +13 -0
  39. package/build/cjs/modules/HistoryComparisonActions/index.js.map +1 -0
  40. package/build/cjs/modules/HistoryHeader/HistoryHeader.d.ts +2 -2
  41. package/build/cjs/modules/HistoryHeader/HistoryHeader.js.map +1 -1
  42. package/build/cjs/modules/HistoryRow/HistoryRow.d.ts +3 -2
  43. package/build/cjs/modules/HistoryRow/HistoryRow.js +2 -4
  44. package/build/cjs/modules/HistoryRow/HistoryRow.js.map +1 -1
  45. package/build/cjs/modules/HistoryRow/HistoryRow.stories.js.map +1 -1
  46. package/build/cjs/modules/HistorySearchRow/HistorySearchRow.d.ts +3 -2
  47. package/build/cjs/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
  48. package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListHeader.js +1 -7
  49. package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListHeader.js.map +1 -1
  50. package/build/cjs/modules/QueriesList/QueriesList.css +10 -0
  51. package/build/cjs/modules/QueriesList/QueriesList.css.map +1 -0
  52. package/build/cjs/modules/QueriesList/QueriesList.d.ts +19 -0
  53. package/build/cjs/modules/QueriesList/QueriesList.js +75 -0
  54. package/build/cjs/modules/QueriesList/QueriesList.js.map +1 -0
  55. package/build/cjs/modules/QueriesList/index.d.ts +2 -0
  56. package/build/cjs/modules/QueriesList/index.js +13 -0
  57. package/build/cjs/modules/QueriesList/index.js.map +1 -0
  58. package/build/cjs/modules/RowsList/RowsList.d.ts +11 -11
  59. package/build/cjs/modules/RowsList/RowsList.js +5 -1
  60. package/build/cjs/modules/RowsList/RowsList.js.map +1 -1
  61. package/build/cjs/modules/RowsList/helpers/prepareRowData.d.ts +9 -9
  62. package/build/cjs/modules/RowsList/helpers/prepareRowData.js.map +1 -1
  63. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.css +17 -0
  64. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.css.map +1 -0
  65. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.d.ts +9 -0
  66. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js +78 -0
  67. package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js.map +1 -0
  68. package/build/cjs/modules/SavedQueryRow/index.d.ts +2 -0
  69. package/build/cjs/modules/SavedQueryRow/index.js +13 -0
  70. package/build/cjs/modules/SavedQueryRow/index.js.map +1 -0
  71. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.css +12 -0
  72. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.css.map +1 -0
  73. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +9 -0
  74. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +65 -0
  75. package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -0
  76. package/build/cjs/modules/SavedQuerySearchRow/index.d.ts +2 -0
  77. package/build/cjs/modules/SavedQuerySearchRow/index.js +13 -0
  78. package/build/cjs/modules/SavedQuerySearchRow/index.js.map +1 -0
  79. package/build/cjs/modules/index.d.ts +8 -2
  80. package/build/cjs/modules/index.js +32 -8
  81. package/build/cjs/modules/index.js.map +1 -1
  82. package/build/cjs/types/history.d.ts +4 -85
  83. package/build/cjs/types/history.js.map +1 -1
  84. package/build/cjs/types/queryList.d.ts +83 -0
  85. package/build/cjs/types/queryList.js +6 -0
  86. package/build/cjs/types/queryList.js.map +1 -0
  87. package/build/cjs/types/savedQueries.d.ts +6 -0
  88. package/build/cjs/types/savedQueries.js +6 -0
  89. package/build/cjs/types/savedQueries.js.map +1 -0
  90. package/build/cjs/types/tutorial.d.ts +2 -2
  91. package/build/cjs/types/tutorial.js.map +1 -1
  92. package/build/cjs/widgets/QueriesHistory/QueriesHistory.css +0 -6
  93. package/build/cjs/widgets/QueriesHistory/QueriesHistory.css.map +1 -1
  94. package/build/cjs/widgets/QueriesHistory/QueriesHistory.d.ts +11 -10
  95. package/build/cjs/widgets/QueriesHistory/QueriesHistory.js +15 -34
  96. package/build/cjs/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
  97. package/build/cjs/widgets/QueriesHistory/QueriesHistory.stories.js.map +1 -1
  98. package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.d.ts +4 -0
  99. package/build/cjs/{modules/HistoryList → widgets/QueriesHistory/internal}/HistoryRowContent.js +4 -5
  100. package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -0
  101. package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.css +3 -0
  102. package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.css.map +1 -1
  103. package/build/cjs/widgets/SavedQueries/SavedQueries.css +4 -0
  104. package/build/cjs/widgets/SavedQueries/SavedQueries.css.map +1 -0
  105. package/build/cjs/widgets/SavedQueries/SavedQueries.d.ts +21 -0
  106. package/build/cjs/widgets/SavedQueries/SavedQueries.js +58 -0
  107. package/build/cjs/widgets/SavedQueries/SavedQueries.js.map +1 -0
  108. package/build/cjs/widgets/SavedQueries/SavedQueries.stories.d.ts +8 -0
  109. package/build/cjs/widgets/SavedQueries/SavedQueries.stories.js +286 -0
  110. package/build/cjs/widgets/SavedQueries/SavedQueries.stories.js.map +1 -0
  111. package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.d.ts +8 -0
  112. package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js +33 -0
  113. package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -0
  114. package/build/cjs/widgets/SavedQueries/i18n/dicts.d.ts +9 -0
  115. package/build/cjs/widgets/SavedQueries/i18n/dicts.js +14 -0
  116. package/build/cjs/widgets/SavedQueries/i18n/dicts.js.map +1 -0
  117. package/build/cjs/widgets/SavedQueries/i18n/en.json +3 -0
  118. package/build/cjs/widgets/SavedQueries/i18n/index.d.ts +6 -0
  119. package/build/cjs/widgets/SavedQueries/i18n/index.js +11 -0
  120. package/build/cjs/widgets/SavedQueries/i18n/index.js.map +1 -0
  121. package/build/cjs/widgets/SavedQueries/i18n/ru.json +3 -0
  122. package/build/cjs/widgets/SavedQueries/index.d.ts +2 -0
  123. package/build/cjs/widgets/SavedQueries/index.js +13 -0
  124. package/build/cjs/widgets/SavedQueries/index.js.map +1 -0
  125. package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
  126. package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
  127. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.d.ts +5 -5
  128. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
  129. package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.stories.js.map +1 -1
  130. package/build/cjs/widgets/index.d.ts +2 -0
  131. package/build/cjs/widgets/index.js +7 -0
  132. package/build/cjs/widgets/index.js.map +1 -1
  133. package/build/esm/components/EditableRowTitle/EditableRowTitle.d.ts +7 -0
  134. package/build/esm/{modules/HistoryRow/HistoryRowTitle.js → components/EditableRowTitle/EditableRowTitle.js} +4 -6
  135. package/build/esm/components/EditableRowTitle/EditableRowTitle.js.map +1 -0
  136. package/build/esm/components/EditableRowTitle/index.d.ts +2 -0
  137. package/build/esm/components/EditableRowTitle/index.js +2 -0
  138. package/build/esm/components/EditableRowTitle/index.js.map +1 -0
  139. package/build/esm/components/HistoryFilter/HistoryFilter.d.ts +2 -2
  140. package/build/esm/components/HistoryFilter/HistoryFilter.js.map +1 -1
  141. package/build/esm/components/LazyList/LazyList.css +0 -2
  142. package/build/esm/components/LazyList/LazyList.css.map +1 -1
  143. package/build/esm/components/LazyList/LazyList.scss +6 -6
  144. package/build/esm/components/RowActionsMenu/RowActionsMenu.d.ts +7 -0
  145. package/build/esm/{modules/HistoryRow/HistoryRowMenu.js → components/RowActionsMenu/RowActionsMenu.js} +8 -5
  146. package/build/esm/components/RowActionsMenu/RowActionsMenu.js.map +1 -0
  147. package/build/esm/components/RowActionsMenu/index.d.ts +2 -0
  148. package/build/esm/components/RowActionsMenu/index.js +2 -0
  149. package/build/esm/components/RowActionsMenu/index.js.map +1 -0
  150. package/build/esm/components/index.d.ts +4 -0
  151. package/build/esm/components/index.js +2 -0
  152. package/build/esm/components/index.js.map +1 -1
  153. package/build/esm/helpers/getListKey.d.ts +2 -2
  154. package/build/esm/helpers/getListKey.js.map +1 -1
  155. package/build/esm/helpers/isFieldVisible.d.ts +5 -4
  156. package/build/esm/helpers/isFieldVisible.js +2 -2
  157. package/build/esm/helpers/isFieldVisible.js.map +1 -1
  158. package/build/esm/helpers/time.d.ts +1 -0
  159. package/build/esm/helpers/time.js +6 -2
  160. package/build/esm/helpers/time.js.map +1 -1
  161. package/build/esm/index.d.ts +2 -0
  162. package/build/esm/index.js +2 -0
  163. package/build/esm/index.js.map +1 -1
  164. package/build/esm/modules/HistoryComparisonActions/HistoryComparisonActions.css +5 -0
  165. package/build/esm/modules/HistoryComparisonActions/HistoryComparisonActions.css.map +1 -0
  166. package/build/esm/modules/HistoryComparisonActions/HistoryComparisonActions.d.ts +8 -0
  167. package/build/esm/{widgets/QueriesHistory/ComparisonActions.js → modules/HistoryComparisonActions/HistoryComparisonActions.js} +10 -10
  168. package/build/esm/modules/HistoryComparisonActions/HistoryComparisonActions.js.map +1 -0
  169. package/build/esm/{widgets/QueriesHistory/ComparisonActions.scss → modules/HistoryComparisonActions/HistoryComparisonActions.scss} +2 -2
  170. package/build/esm/modules/HistoryComparisonActions/index.d.ts +2 -0
  171. package/build/esm/modules/HistoryComparisonActions/index.js +2 -0
  172. package/build/esm/modules/HistoryComparisonActions/index.js.map +1 -0
  173. package/build/esm/modules/HistoryHeader/HistoryHeader.d.ts +2 -2
  174. package/build/esm/modules/HistoryHeader/HistoryHeader.js.map +1 -1
  175. package/build/esm/modules/HistoryRow/HistoryRow.d.ts +3 -2
  176. package/build/esm/modules/HistoryRow/HistoryRow.js +3 -5
  177. package/build/esm/modules/HistoryRow/HistoryRow.js.map +1 -1
  178. package/build/esm/modules/HistoryRow/HistoryRow.stories.js.map +1 -1
  179. package/build/esm/modules/HistorySearchRow/HistorySearchRow.d.ts +3 -2
  180. package/build/esm/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
  181. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListHeader.js +1 -7
  182. package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListHeader.js.map +1 -1
  183. package/build/esm/modules/QueriesList/QueriesList.css +10 -0
  184. package/build/esm/modules/QueriesList/QueriesList.css.map +1 -0
  185. package/build/esm/modules/QueriesList/QueriesList.d.ts +19 -0
  186. package/build/esm/modules/QueriesList/QueriesList.js +68 -0
  187. package/build/esm/modules/QueriesList/QueriesList.js.map +1 -0
  188. package/build/esm/modules/QueriesList/QueriesList.scss +10 -0
  189. package/build/esm/modules/QueriesList/index.d.ts +2 -0
  190. package/build/esm/modules/QueriesList/index.js +2 -0
  191. package/build/esm/modules/QueriesList/index.js.map +1 -0
  192. package/build/esm/modules/RowsList/RowsList.d.ts +11 -11
  193. package/build/esm/modules/RowsList/RowsList.js +5 -1
  194. package/build/esm/modules/RowsList/RowsList.js.map +1 -1
  195. package/build/esm/modules/RowsList/helpers/prepareRowData.d.ts +9 -9
  196. package/build/esm/modules/RowsList/helpers/prepareRowData.js.map +1 -1
  197. package/build/esm/modules/SavedQueryRow/SavedQueryRow.css +17 -0
  198. package/build/esm/modules/SavedQueryRow/SavedQueryRow.css.map +1 -0
  199. package/build/esm/modules/SavedQueryRow/SavedQueryRow.d.ts +9 -0
  200. package/build/esm/modules/SavedQueryRow/SavedQueryRow.js +71 -0
  201. package/build/esm/modules/SavedQueryRow/SavedQueryRow.js.map +1 -0
  202. package/build/esm/modules/SavedQueryRow/SavedQueryRow.scss +20 -0
  203. package/build/esm/modules/SavedQueryRow/index.d.ts +2 -0
  204. package/build/esm/modules/SavedQueryRow/index.js +2 -0
  205. package/build/esm/modules/SavedQueryRow/index.js.map +1 -0
  206. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.css +12 -0
  207. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.css.map +1 -0
  208. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +9 -0
  209. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +58 -0
  210. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -0
  211. package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.scss +15 -0
  212. package/build/esm/modules/SavedQuerySearchRow/index.d.ts +2 -0
  213. package/build/esm/modules/SavedQuerySearchRow/index.js +2 -0
  214. package/build/esm/modules/SavedQuerySearchRow/index.js.map +1 -0
  215. package/build/esm/modules/index.d.ts +8 -2
  216. package/build/esm/modules/index.js +4 -1
  217. package/build/esm/modules/index.js.map +1 -1
  218. package/build/esm/types/history.d.ts +4 -85
  219. package/build/esm/types/history.js.map +1 -1
  220. package/build/esm/types/queryList.d.ts +83 -0
  221. package/build/esm/types/queryList.js +2 -0
  222. package/build/esm/types/queryList.js.map +1 -0
  223. package/build/esm/types/savedQueries.d.ts +6 -0
  224. package/build/esm/types/savedQueries.js +2 -0
  225. package/build/esm/types/savedQueries.js.map +1 -0
  226. package/build/esm/types/tutorial.d.ts +2 -2
  227. package/build/esm/types/tutorial.js.map +1 -1
  228. package/build/esm/widgets/QueriesHistory/QueriesHistory.css +0 -6
  229. package/build/esm/widgets/QueriesHistory/QueriesHistory.css.map +1 -1
  230. package/build/esm/widgets/QueriesHistory/QueriesHistory.d.ts +11 -10
  231. package/build/esm/widgets/QueriesHistory/QueriesHistory.js +16 -35
  232. package/build/esm/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
  233. package/build/esm/widgets/QueriesHistory/QueriesHistory.scss +1 -8
  234. package/build/esm/widgets/QueriesHistory/QueriesHistory.stories.js.map +1 -1
  235. package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.d.ts +4 -0
  236. package/build/esm/{modules/HistoryList → widgets/QueriesHistory/internal}/HistoryRowContent.js +2 -3
  237. package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -0
  238. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.css +3 -0
  239. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.css.map +1 -1
  240. package/build/esm/widgets/QueriesNavigation/QueriesNavigation.scss +2 -0
  241. package/build/esm/widgets/SavedQueries/SavedQueries.css +4 -0
  242. package/build/esm/widgets/SavedQueries/SavedQueries.css.map +1 -0
  243. package/build/esm/widgets/SavedQueries/SavedQueries.d.ts +21 -0
  244. package/build/esm/widgets/SavedQueries/SavedQueries.js +51 -0
  245. package/build/esm/widgets/SavedQueries/SavedQueries.js.map +1 -0
  246. package/build/esm/widgets/SavedQueries/SavedQueries.scss +3 -0
  247. package/build/esm/widgets/SavedQueries/SavedQueries.stories.d.ts +8 -0
  248. package/build/esm/widgets/SavedQueries/SavedQueries.stories.js +278 -0
  249. package/build/esm/widgets/SavedQueries/SavedQueries.stories.js.map +1 -0
  250. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.d.ts +8 -0
  251. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js +26 -0
  252. package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -0
  253. package/build/esm/widgets/SavedQueries/i18n/dicts.d.ts +9 -0
  254. package/build/esm/widgets/SavedQueries/i18n/dicts.js +7 -0
  255. package/build/esm/widgets/SavedQueries/i18n/dicts.js.map +1 -0
  256. package/build/esm/widgets/SavedQueries/i18n/en.json +3 -0
  257. package/build/esm/widgets/SavedQueries/i18n/index.d.ts +6 -0
  258. package/build/esm/widgets/SavedQueries/i18n/index.js +4 -0
  259. package/build/esm/widgets/SavedQueries/i18n/index.js.map +1 -0
  260. package/build/esm/widgets/SavedQueries/i18n/ru.json +3 -0
  261. package/build/esm/widgets/SavedQueries/index.d.ts +2 -0
  262. package/build/esm/widgets/SavedQueries/index.js +2 -0
  263. package/build/esm/widgets/SavedQueries/index.js.map +1 -0
  264. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
  265. package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
  266. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.d.ts +5 -5
  267. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
  268. package/build/esm/widgets/TutorialsHistory/TutorialsHistory.stories.js.map +1 -1
  269. package/build/esm/widgets/index.d.ts +2 -0
  270. package/build/esm/widgets/index.js +1 -0
  271. package/build/esm/widgets/index.js.map +1 -1
  272. package/package.json +1 -1
  273. package/src/{modules/HistoryRow/HistoryRowTitle.tsx → components/EditableRowTitle/EditableRowTitle.tsx} +10 -12
  274. package/src/components/EditableRowTitle/index.ts +2 -0
  275. package/src/components/HistoryFilter/HistoryFilter.tsx +2 -2
  276. package/src/components/LazyList/LazyList.scss +6 -6
  277. package/src/components/RowActionsMenu/RowActionsMenu.tsx +47 -0
  278. package/src/components/RowActionsMenu/index.ts +2 -0
  279. package/src/components/index.ts +4 -0
  280. package/src/helpers/getListKey.ts +4 -4
  281. package/src/helpers/isFieldVisible.ts +5 -4
  282. package/src/helpers/time.ts +4 -0
  283. package/src/index.ts +2 -0
  284. package/src/{widgets/QueriesHistory/ComparisonActions.scss → modules/HistoryComparisonActions/HistoryComparisonActions.scss} +2 -2
  285. package/src/{widgets/QueriesHistory/ComparisonActions.tsx → modules/HistoryComparisonActions/HistoryComparisonActions.tsx} +8 -8
  286. package/src/modules/HistoryComparisonActions/index.ts +2 -0
  287. package/src/modules/HistoryHeader/HistoryHeader.tsx +2 -2
  288. package/src/modules/HistoryRow/HistoryRow.stories.tsx +3 -2
  289. package/src/modules/HistoryRow/HistoryRow.tsx +13 -7
  290. package/src/modules/HistorySearchRow/HistorySearchRow.tsx +3 -2
  291. package/src/modules/NavigationItemsList/internal/NavigationItemsListHeader.tsx +1 -5
  292. package/src/modules/QueriesList/QueriesList.scss +10 -0
  293. package/src/modules/QueriesList/QueriesList.tsx +98 -0
  294. package/src/modules/QueriesList/index.ts +2 -0
  295. package/src/modules/RowsList/RowsList.tsx +27 -23
  296. package/src/modules/RowsList/helpers/prepareRowData.ts +18 -18
  297. package/src/modules/SavedQueryRow/SavedQueryRow.scss +20 -0
  298. package/src/modules/SavedQueryRow/SavedQueryRow.tsx +60 -0
  299. package/src/modules/SavedQueryRow/index.ts +2 -0
  300. package/src/modules/SavedQuerySearchRow/SavedQuerySearchRow.scss +15 -0
  301. package/src/modules/SavedQuerySearchRow/SavedQuerySearchRow.tsx +58 -0
  302. package/src/modules/SavedQuerySearchRow/index.ts +2 -0
  303. package/src/modules/index.ts +8 -2
  304. package/src/types/history.ts +4 -95
  305. package/src/types/queryList.ts +92 -0
  306. package/src/types/savedQueries.ts +7 -0
  307. package/src/types/tutorial.ts +2 -2
  308. package/src/widgets/QueriesHistory/QueriesHistory.scss +1 -8
  309. package/src/widgets/QueriesHistory/QueriesHistory.stories.tsx +11 -11
  310. package/src/widgets/QueriesHistory/QueriesHistory.tsx +35 -61
  311. package/src/{modules/HistoryList → widgets/QueriesHistory/internal}/HistoryRowContent.tsx +5 -5
  312. package/src/widgets/QueriesNavigation/QueriesNavigation.scss +2 -0
  313. package/src/widgets/SavedQueries/SavedQueries.scss +3 -0
  314. package/src/widgets/SavedQueries/SavedQueries.stories.tsx +192 -0
  315. package/src/widgets/SavedQueries/SavedQueries.tsx +77 -0
  316. package/src/widgets/SavedQueries/SavedQueryRowContent.tsx +26 -0
  317. package/src/widgets/SavedQueries/i18n/dicts.ts +4 -0
  318. package/src/widgets/SavedQueries/i18n/en.json +3 -0
  319. package/src/widgets/SavedQueries/i18n/index.ts +4 -0
  320. package/src/widgets/SavedQueries/i18n/ru.json +3 -0
  321. package/src/widgets/SavedQueries/index.ts +2 -0
  322. package/src/widgets/TutorialsHistory/TutorialRowContent.tsx +2 -2
  323. package/src/widgets/TutorialsHistory/TutorialsHistory.stories.tsx +3 -3
  324. package/src/widgets/TutorialsHistory/TutorialsHistory.tsx +5 -9
  325. package/src/widgets/index.ts +2 -0
  326. package/build/cjs/modules/HistoryList/HistoryList.d.ts +0 -16
  327. package/build/cjs/modules/HistoryList/HistoryList.js +0 -24
  328. package/build/cjs/modules/HistoryList/HistoryList.js.map +0 -1
  329. package/build/cjs/modules/HistoryList/HistoryList.stories.d.ts +0 -14
  330. package/build/cjs/modules/HistoryList/HistoryList.stories.js +0 -245
  331. package/build/cjs/modules/HistoryList/HistoryList.stories.js.map +0 -1
  332. package/build/cjs/modules/HistoryList/HistoryRowContent.d.ts +0 -3
  333. package/build/cjs/modules/HistoryList/HistoryRowContent.js.map +0 -1
  334. package/build/cjs/modules/HistoryList/index.d.ts +0 -2
  335. package/build/cjs/modules/HistoryList/index.js +0 -13
  336. package/build/cjs/modules/HistoryList/index.js.map +0 -1
  337. package/build/cjs/modules/HistoryRow/HistoryRowMenu.d.ts +0 -8
  338. package/build/cjs/modules/HistoryRow/HistoryRowMenu.js.map +0 -1
  339. package/build/cjs/modules/HistoryRow/HistoryRowTitle.d.ts +0 -8
  340. package/build/cjs/modules/HistoryRow/HistoryRowTitle.js.map +0 -1
  341. package/build/cjs/widgets/QueriesHistory/ComparisonActions.css +0 -5
  342. package/build/cjs/widgets/QueriesHistory/ComparisonActions.css.map +0 -1
  343. package/build/cjs/widgets/QueriesHistory/ComparisonActions.d.ts +0 -9
  344. package/build/cjs/widgets/QueriesHistory/ComparisonActions.js.map +0 -1
  345. package/build/esm/modules/HistoryList/HistoryList.d.ts +0 -16
  346. package/build/esm/modules/HistoryList/HistoryList.js +0 -17
  347. package/build/esm/modules/HistoryList/HistoryList.js.map +0 -1
  348. package/build/esm/modules/HistoryList/HistoryList.stories.d.ts +0 -14
  349. package/build/esm/modules/HistoryList/HistoryList.stories.js +0 -237
  350. package/build/esm/modules/HistoryList/HistoryList.stories.js.map +0 -1
  351. package/build/esm/modules/HistoryList/HistoryRowContent.d.ts +0 -3
  352. package/build/esm/modules/HistoryList/HistoryRowContent.js.map +0 -1
  353. package/build/esm/modules/HistoryList/index.d.ts +0 -2
  354. package/build/esm/modules/HistoryList/index.js +0 -2
  355. package/build/esm/modules/HistoryList/index.js.map +0 -1
  356. package/build/esm/modules/HistoryRow/HistoryRowMenu.d.ts +0 -8
  357. package/build/esm/modules/HistoryRow/HistoryRowMenu.js.map +0 -1
  358. package/build/esm/modules/HistoryRow/HistoryRowTitle.d.ts +0 -8
  359. package/build/esm/modules/HistoryRow/HistoryRowTitle.js.map +0 -1
  360. package/build/esm/widgets/QueriesHistory/ComparisonActions.css +0 -5
  361. package/build/esm/widgets/QueriesHistory/ComparisonActions.css.map +0 -1
  362. package/build/esm/widgets/QueriesHistory/ComparisonActions.d.ts +0 -9
  363. package/build/esm/widgets/QueriesHistory/ComparisonActions.js.map +0 -1
  364. package/src/modules/HistoryList/HistoryList.stories.tsx +0 -181
  365. package/src/modules/HistoryList/HistoryList.tsx +0 -41
  366. package/src/modules/HistoryList/index.ts +0 -2
  367. package/src/modules/HistoryRow/HistoryRowMenu.tsx +0 -47
@@ -0,0 +1,4 @@
1
+ import { addI18Keysets } from "../../../i18n";
2
+ import dicts from "./dicts";
3
+ export default addI18Keysets('qp:saved-queries', dicts);
4
+ // #sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["addI18Keysets","dicts"],"sources":["index.ts"],"sourcesContent":["import {addI18Keysets} from '../../../i18n';\nimport dicts from './dicts';\n\nexport default addI18Keysets('qp:saved-queries', dicts);\n"],"mappings":"AAAA,SAAQA,aAAa;AACrB,OAAOC,KAAK;AAEZ,eAAeD,aAAa,CAAC,kBAAkB,EAAEC,KAAK,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "title_saved": "Сохранённые"
3
+ }
@@ -0,0 +1,2 @@
1
+ export { SavedQueries } from './SavedQueries';
2
+ export type { SavedQueriesProps } from './SavedQueries';
@@ -0,0 +1,2 @@
1
+ export { SavedQueries } from "./SavedQueries";
2
+ // #sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SavedQueries"],"sources":["index.ts"],"sourcesContent":["export {SavedQueries} from './SavedQueries';\nexport type {SavedQueriesProps} from './SavedQueries';\n"],"mappings":"AAAA,SAAQA,YAAY","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryHistoryRowRenderData } from '../../types/history';
2
+ import { QueryListRowRenderData } from '../../types/queryList';
3
3
  import { TutorialHistoryRow } from '../../types/tutorial';
4
- export declare const TutorialRowContent: <T extends TutorialHistoryRow>({ item, variant, }: QueryHistoryRowRenderData<T>) => React.JSX.Element;
4
+ export declare const TutorialRowContent: <T extends TutorialHistoryRow>({ item, variant, }: QueryListRowRenderData<T>) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"names":["React","HistoryGroupHeader","TutorialRow","TutorialSearchRow","jsx","_jsx","TutorialRowContent","_ref","item","variant","title","header"],"sources":["TutorialRowContent.tsx"],"sourcesContent":["import React from 'react';\nimport {QueryHistoryRowRenderData} from '../../types/history';\nimport {TutorialHistoryRow} from '../../types/tutorial';\nimport {HistoryGroupHeader} from '../../components';\nimport {TutorialRow, TutorialSearchRow} from '../../modules';\n\nexport const TutorialRowContent = <T extends TutorialHistoryRow>({\n item,\n variant,\n}: QueryHistoryRowRenderData<T>) => {\n if ('header' in item) {\n return <HistoryGroupHeader title={item.header} />;\n }\n\n return variant === 'search' ? <TutorialSearchRow item={item} /> : <TutorialRow item={item} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAAQC,kBAAkB;AAC1B,SAAQC,WAAW,EAAEC,iBAAiB;AAAuB,SAAAC,GAAA,IAAAC,IAAA;AAE7D,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAGK;EAAA,IAFhCC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,OAAO,GAAAF,IAAA,CAAPE,OAAO;EAEP,IAAI,QAAQ,IAAID,IAAI,EAAE;IAClB,oBAAOH,IAAA,CAACJ,kBAAkB;MAACS,KAAK,EAAEF,IAAI,CAACG;IAAO,CAAE,CAAC;EACrD;EAEA,OAAOF,OAAO,KAAK,QAAQ,gBAAGJ,IAAA,CAACF,iBAAiB;IAACK,IAAI,EAAEA;EAAK,CAAE,CAAC,gBAAGH,IAAA,CAACH,WAAW;IAACM,IAAI,EAAEA;EAAK,CAAE,CAAC;AACjG,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","HistoryGroupHeader","TutorialRow","TutorialSearchRow","jsx","_jsx","TutorialRowContent","_ref","item","variant","title","header"],"sources":["TutorialRowContent.tsx"],"sourcesContent":["import React from 'react';\nimport {QueryListRowRenderData} from '../../types/queryList';\nimport {TutorialHistoryRow} from '../../types/tutorial';\nimport {HistoryGroupHeader} from '../../components';\nimport {TutorialRow, TutorialSearchRow} from '../../modules';\n\nexport const TutorialRowContent = <T extends TutorialHistoryRow>({\n item,\n variant,\n}: QueryListRowRenderData<T>) => {\n if ('header' in item) {\n return <HistoryGroupHeader title={item.header} />;\n }\n\n return variant === 'search' ? <TutorialSearchRow item={item} /> : <TutorialRow item={item} />;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAAQC,kBAAkB;AAC1B,SAAQC,WAAW,EAAEC,iBAAiB;AAAuB,SAAAC,GAAA,IAAAC,IAAA;AAE7D,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAGE;EAAA,IAF7BC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,OAAO,GAAAF,IAAA,CAAPE,OAAO;EAEP,IAAI,QAAQ,IAAID,IAAI,EAAE;IAClB,oBAAOH,IAAA,CAACJ,kBAAkB;MAACS,KAAK,EAAEF,IAAI,CAACG;IAAO,CAAE,CAAC;EACrD;EAEA,OAAOF,OAAO,KAAK,QAAQ,gBAAGJ,IAAA,CAACF,iBAAiB;IAACK,IAAI,EAAEA;EAAK,CAAE,CAAC,gBAAGH,IAAA,CAACH,WAAW;IAACM,IAAI,EAAEA;EAAK,CAAE,CAAC;AACjG,CAAC","ignoreList":[]}
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
- import { QueryHistoryFilterConfig, QueryHistoryItem, QueryHistorySearchConfig } from '../../types/history';
2
+ import { QueryListFilterConfig, QueryListItem, QueryListSearchConfig } from '../../types/queryList';
3
3
  import { TutorialHistoryRow } from '../../types/tutorial';
4
4
  import './TutorialsHistory.scss';
5
5
  export type TutorialsHistoryProps<T extends TutorialHistoryRow = TutorialHistoryRow> = {
6
6
  className?: string;
7
7
  title?: string;
8
8
  logo?: React.ReactNode;
9
- search: QueryHistorySearchConfig;
10
- filter?: QueryHistoryFilterConfig;
11
- items: QueryHistoryItem<T>[];
9
+ search: QueryListSearchConfig;
10
+ filter?: QueryListFilterConfig;
11
+ items: QueryListItem<T>[];
12
12
  selectedRowId?: T['id'];
13
- onListItemClick?: (item: QueryHistoryItem<T>) => void;
13
+ onListItemClick?: (item: QueryListItem<T>) => void;
14
14
  };
15
15
  export declare const TutorialsHistory: <T extends TutorialHistoryRow>({ title, logo, search, filter, items, selectedRowId, onListItemClick, className, }: TutorialsHistoryProps<T>) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"names":["React","HistoryHeader","HistoryLayout","RowsList","i18n","getListKey","TutorialRowContent","cn","jsx","_jsx","block","TutorialsHistory","_ref","_search$value","title","logo","search","filter","items","selectedRowId","onListItemClick","className","showSearchResults","Boolean","fullSearch","value","trim","rowVariant","header","hasClear","onUpdate","children","renderRow","data","_objectSpread","showFiltersHint","onItemClick"],"sources":["TutorialsHistory.tsx"],"sourcesContent":["import React from 'react';\nimport {HistoryHeader, HistoryLayout, RowsList} from '../../modules';\nimport i18n from './i18n';\nimport {\n QueryHistoryFilterConfig,\n QueryHistoryItem,\n QueryHistorySearchConfig,\n} from '../../types/history';\nimport {TutorialHistoryRow} from '../../types/tutorial';\nimport {getListKey} from '../../helpers/getListKey';\nimport {TutorialRowContent} from './TutorialRowContent';\nimport cn from 'bem-cn-lite';\nimport './TutorialsHistory.scss';\n\nexport type TutorialsHistoryProps<T extends TutorialHistoryRow = TutorialHistoryRow> = {\n className?: string;\n title?: string;\n logo?: React.ReactNode;\n search: QueryHistorySearchConfig;\n filter?: QueryHistoryFilterConfig;\n items: QueryHistoryItem<T>[];\n selectedRowId?: T['id'];\n onListItemClick?: (item: QueryHistoryItem<T>) => void;\n};\n\nconst block = cn('qp-tutorials-history');\n\nexport const TutorialsHistory = <T extends TutorialHistoryRow>({\n title,\n logo,\n search,\n filter,\n items,\n selectedRowId,\n onListItemClick,\n className,\n}: TutorialsHistoryProps<T>) => {\n const showSearchResults = Boolean(search.fullSearch && search.value?.trim());\n const rowVariant = showSearchResults ? 'search' : 'default';\n\n return (\n <HistoryLayout\n className={block(null, className)}\n title={title || i18n('title_tutorials')}\n logo={logo}\n header={\n <HistoryHeader\n search={search.value}\n fullSearch={search.fullSearch}\n hasClear={search.hasClear}\n filter={filter}\n onUpdate={search.onUpdate}\n />\n }\n >\n <RowsList\n key={getListKey(items, rowVariant)}\n items={items}\n rowVariant={rowVariant}\n selectedRowId={selectedRowId}\n renderRow={(data) => <TutorialRowContent {...data} />}\n showFiltersHint={Boolean(filter)}\n onItemClick={onListItemClick}\n />\n </HistoryLayout>\n );\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,QAAS;MAC1BZ,MAAM,EAAEA,MAAO;MACfa,QAAQ,EAAEd,MAAM,CAACc;IAAS,CAC7B,CACJ;IAAAC,QAAA,eAEDtB,IAAA,CAACN,QAAQ;MAELe,KAAK,EAAEA,KAAM;MACbS,UAAU,EAAEA,UAAW;MACvBR,aAAa,EAAEA,aAAc;MAC7Ba,SAAS,EAAE,SAAXA,SAASA,CAAGC,IAAI;QAAA,oBAAKxB,IAAA,CAACH,kBAAkB,EAAA4B,aAAA,KAAKD,IAAI,CAAG,CAAC;MAAA,CAAC;MACtDE,eAAe,EAAEZ,OAAO,CAACN,MAAM,CAAE;MACjCmB,WAAW,EAAEhB;IAAgB,GANxBf,UAAU,CAACa,KAAK,EAAES,UAAU,CAOpC;EAAC,CACS,CAAC;AAExB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","HistoryHeader","HistoryLayout","RowsList","i18n","getListKey","TutorialRowContent","cn","jsx","_jsx","block","TutorialsHistory","_ref","_search$value","title","logo","search","filter","items","selectedRowId","onListItemClick","className","showSearchResults","Boolean","fullSearch","value","trim","rowVariant","header","hasClear","onUpdate","children","renderRow","data","_objectSpread","showFiltersHint","onItemClick"],"sources":["TutorialsHistory.tsx"],"sourcesContent":["import React from 'react';\nimport {HistoryHeader, HistoryLayout, RowsList} from '../../modules';\nimport i18n from './i18n';\nimport {QueryListFilterConfig, QueryListItem, QueryListSearchConfig} from '../../types/queryList';\nimport {TutorialHistoryRow} from '../../types/tutorial';\nimport {getListKey} from '../../helpers/getListKey';\nimport {TutorialRowContent} from './TutorialRowContent';\nimport cn from 'bem-cn-lite';\nimport './TutorialsHistory.scss';\n\nexport type TutorialsHistoryProps<T extends TutorialHistoryRow = TutorialHistoryRow> = {\n className?: string;\n title?: string;\n logo?: React.ReactNode;\n search: QueryListSearchConfig;\n filter?: QueryListFilterConfig;\n items: QueryListItem<T>[];\n selectedRowId?: T['id'];\n onListItemClick?: (item: QueryListItem<T>) => void;\n};\n\nconst block = cn('qp-tutorials-history');\n\nexport const TutorialsHistory = <T extends TutorialHistoryRow>({\n title,\n logo,\n search,\n filter,\n items,\n selectedRowId,\n onListItemClick,\n className,\n}: TutorialsHistoryProps<T>) => {\n const showSearchResults = Boolean(search.fullSearch && search.value?.trim());\n const rowVariant = showSearchResults ? 'search' : 'default';\n\n return (\n <HistoryLayout\n className={block(null, className)}\n title={title || i18n('title_tutorials')}\n logo={logo}\n header={\n <HistoryHeader\n search={search.value}\n fullSearch={search.fullSearch}\n hasClear={search.hasClear}\n filter={filter}\n onUpdate={search.onUpdate}\n />\n }\n >\n <RowsList\n key={getListKey(items, rowVariant)}\n items={items}\n rowVariant={rowVariant}\n selectedRowId={selectedRowId}\n renderRow={(data) => <TutorialRowContent {...data} />}\n showFiltersHint={Boolean(filter)}\n onItemClick={onListItemClick}\n />\n </HistoryLayout>\n );\n};\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,aAAa,EAAEC,aAAa,EAAEC,QAAQ;AAC9C,OAAOC,IAAI;AAGX,SAAQC,UAAU;AAClB,SAAQC,kBAAkB;AAC1B,OAAOC,EAAE,MAAM,aAAa;AAC5B;AAAiC,SAAAC,GAAA,IAAAC,IAAA;AAajC,IAAMC,KAAK,GAAGH,EAAE,CAAC,sBAAsB,CAAC;AAExC,OAAO,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EASG;EAAA,IAAAC,aAAA;EAAA,IAR5BC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IACNC,MAAM,GAAAL,IAAA,CAANK,MAAM;IACNC,KAAK,GAAAN,IAAA,CAALM,KAAK;IACLC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,eAAe,GAAAR,IAAA,CAAfQ,eAAe;IACfC,SAAS,GAAAT,IAAA,CAATS,SAAS;EAET,IAAMC,iBAAiB,GAAGC,OAAO,CAACP,MAAM,CAACQ,UAAU,MAAAX,aAAA,GAAIG,MAAM,CAACS,KAAK,cAAAZ,aAAA,uBAAZA,aAAA,CAAca,IAAI,CAAC,CAAC,EAAC;EAC5E,IAAMC,UAAU,GAAGL,iBAAiB,GAAG,QAAQ,GAAG,SAAS;EAE3D,oBACIb,IAAA,CAACP,aAAa;IACVmB,SAAS,EAAEX,KAAK,CAAC,IAAI,EAAEW,SAAS,CAAE;IAClCP,KAAK,EAAEA,KAAK,IAAIV,IAAI,CAAC,iBAAiB,CAAE;IACxCW,IAAI,EAAEA,IAAK;IACXa,MAAM,eACFnB,IAAA,CAACR,aAAa;MACVe,MAAM,EAAEA,MAAM,CAACS,KAAM;MACrBD,UAAU,EAAER,MAAM,CAACQ,UAAW;MAC9BK,QAAQ,EAAEb,MAAM,CAACa,QAAS;MAC1BZ,MAAM,EAAEA,MAAO;MACfa,QAAQ,EAAEd,MAAM,CAACc;IAAS,CAC7B,CACJ;IAAAC,QAAA,eAEDtB,IAAA,CAACN,QAAQ;MAELe,KAAK,EAAEA,KAAM;MACbS,UAAU,EAAEA,UAAW;MACvBR,aAAa,EAAEA,aAAc;MAC7Ba,SAAS,EAAE,SAAXA,SAASA,CAAGC,IAAI;QAAA,oBAAKxB,IAAA,CAACH,kBAAkB,EAAA4B,aAAA,KAAKD,IAAI,CAAG,CAAC;MAAA,CAAC;MACtDE,eAAe,EAAEZ,OAAO,CAACN,MAAM,CAAE;MACjCmB,WAAW,EAAEhB;IAAgB,GANxBf,UAAU,CAACa,KAAK,EAAES,UAAU,CAOpC;EAAC,CACS,CAAC;AAExB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","TutorialsHistory","action","jsx","_jsx","QUERY","filterFields","id","type","title","initialValue","items","logFilterApply","logFilterReset","BASE_ITEMS","query","height","meta","component","tags","parameters","layout","DefaultStory","_useState","concat","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","handleOnSearch","data","newItems","filter","item","_item$query","toLowerCase","searchValue","includes","style","width","children","fields","onApply","onReset","hasClear","onUpdate","EmptyStory","_useState5","_useState6","Default","render","Empty"],"sources":["TutorialsHistory.stories.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {TutorialsHistory} from './TutorialsHistory';\nimport {QueryHistoryFilterConfig, QueryHistoryItem} from '../../types/history';\nimport {TutorialHistoryRow} from '../../types/tutorial';\nimport {action} from 'storybook/actions';\n\nconst QUERY = `use test;\n\nSELECT\n \"test_session\" AS session_id,\n \"test_task\" AS task_id,\n SUBSTRING(\"test\", 1, 1) AS truncated_char`;\n\nconst filterFields: QueryHistoryFilterConfig['fields'] = [\n {id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},\n {id: 'range', type: 'rangeDatePicker', title: 'Period'},\n {\n id: 'dialect',\n type: 'checkboxGroup',\n title: 'Dialect',\n initialValue: [],\n items: [\n {id: 'yql', title: 'YQL'},\n {id: 'sql', title: 'SQL'},\n ],\n },\n];\n\nconst logFilterApply = action('onFilterApply');\nconst logFilterReset = action('onFilterReset');\n\nconst BASE_ITEMS: QueryHistoryItem<TutorialHistoryRow>[] = [\n {\n id: 1,\n title: 'Getting started with YQL',\n query: QUERY,\n height: 28,\n },\n {\n id: 2,\n title: 'Working with tables',\n query: QUERY,\n height: 28,\n },\n {\n id: 3,\n title: 'Window functions',\n query: QUERY,\n height: 28,\n },\n];\n\nconst meta: Meta<typeof TutorialsHistory> = {\n title: 'Widgets/TutorialsHistory',\n component: TutorialsHistory,\n tags: ['autodocs'],\n parameters: {\n layout: 'padded',\n },\n};\n\nexport default meta;\ntype Story = StoryObj<typeof TutorialsHistory>;\n\nconst DefaultStory = () => {\n const [items, setItems] = useState([...BASE_ITEMS]);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n const handleOnSearch = (data: {value: string; fullSearch: boolean}) => {\n setSearch(data);\n\n if (!data.value) {\n setItems(BASE_ITEMS);\n return;\n }\n\n const newItems = BASE_ITEMS.filter((item) => {\n if (!('id' in item)) return false;\n\n const title = item.title.toLowerCase();\n const query = item.query?.toLowerCase();\n const searchValue = data.value.toLowerCase();\n\n if (data.fullSearch) {\n return title.includes(searchValue) || query?.includes(searchValue);\n }\n\n return title.includes(searchValue);\n });\n setItems(newItems);\n };\n\n return (\n <div style={{width: 300, height: 500}}>\n <TutorialsHistory\n title=\"Tutorials\"\n items={items}\n filter={{\n fields: filterFields,\n onApply: logFilterApply,\n onReset: logFilterReset('reset'),\n }}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: handleOnSearch,\n }}\n />\n </div>\n );\n};\n\nconst EmptyStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 300, height: 500}}>\n <TutorialsHistory\n title=\"Tutorials\"\n items={[]}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: setSearch,\n }}\n />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <DefaultStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAGC,QAAQ,QAAO,OAAO;AAErC,SAAQC,gBAAgB;AAGxB,SAAQC,MAAM,QAAO,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,IAAMC,KAAK,6IAKmC;AAE9C,IAAMC,YAAgD,GAAG,CACrD;EAACC,EAAE,EAAE,UAAU;EAAEC,IAAI,EAAE,QAAQ;EAAEC,KAAK,EAAE,iBAAiB;EAAEC,YAAY,EAAE;AAAI,CAAC,EAC9E;EAACH,EAAE,EAAE,OAAO;EAAEC,IAAI,EAAE,iBAAiB;EAAEC,KAAK,EAAE;AAAQ,CAAC,EACvD;EACIF,EAAE,EAAE,SAAS;EACbC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,SAAS;EAChBC,YAAY,EAAE,EAAE;EAChBC,KAAK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KAAK,EAAEG,MAAM,CAACH,KAAK;QACnBC,UAAU,EAAEE,MAAM,CAACF,UAAU;QAC7BmB,QAAQ,EAAE,IAAI;QACdC,QAAQ,EAAEhB;MACd;IAAE,CACL;EAAC,CACD,CAAC;AAEd,CAAC;AAED,IAAMiB,UAAU,GAAG,SAAbA,UAAUA,CAAA,EAAS;EACrB,IAAAC,UAAA,GAA4BpD,QAAQ,CAAC;MAAC6B,KAAK,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAC,CAAC;IAAAuB,UAAA,GAAA3B,cAAA,CAAA0B,UAAA;IAA7DpB,MAAM,GAAAqB,UAAA;IAAEpB,SAAS,GAAAoB,UAAA;EAExB,oBACIjD,IAAA;IAAKuC,KAAK,EAAE;MAACC,KAAK,EAAE,GAAG;MAAE5B,MAAM,EAAE;IAAG,CAAE;IAAA6B,QAAA,eAClCzC,IAAA,CAACH,gBAAgB;MACbQ,KAAK,EAAC,WAAW;MACjBE,KAAK,EAAE,EAAG;MACVqB,MAAM,EAAE;QACJH,KAAK,EAAEG,MAAM,CAACH,KAAK;QACnBC,UAAU,EAAEE,MAAM,CAACF,UAAU;QAC7BmB,QAAQ,EAAE,IAAI;QACdC,QAAQ,EAAEjB;MACd;IAAE,CACL;EAAC,CACD,CAAC;AAEd,CAAC;AAED,OAAO,IAAMqB,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQnD,IAAA,CAACkB,YAAY,IAAE,CAAC;EAAA;AAAA,CAAC;AAC9D,OAAO,IAAMkC,KAAY,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQnD,IAAA,CAAC+C,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useState","TutorialsHistory","action","jsx","_jsx","QUERY","filterFields","id","type","title","initialValue","items","logFilterApply","logFilterReset","BASE_ITEMS","query","height","meta","component","tags","parameters","layout","DefaultStory","_useState","concat","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","handleOnSearch","data","newItems","filter","item","_item$query","toLowerCase","searchValue","includes","style","width","children","fields","onApply","onReset","hasClear","onUpdate","EmptyStory","_useState5","_useState6","Default","render","Empty"],"sources":["TutorialsHistory.stories.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {TutorialsHistory} from './TutorialsHistory';\nimport {QueryListFilterConfig, QueryListItem} from '../../types/queryList';\nimport {TutorialHistoryRow} from '../../types/tutorial';\nimport {action} from 'storybook/actions';\n\nconst QUERY = `use test;\n\nSELECT\n \"test_session\" AS session_id,\n \"test_task\" AS task_id,\n SUBSTRING(\"test\", 1, 1) AS truncated_char`;\n\nconst filterFields: QueryListFilterConfig['fields'] = [\n {id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},\n {id: 'range', type: 'rangeDatePicker', title: 'Period'},\n {\n id: 'dialect',\n type: 'checkboxGroup',\n title: 'Dialect',\n initialValue: [],\n items: [\n {id: 'yql', title: 'YQL'},\n {id: 'sql', title: 'SQL'},\n ],\n },\n];\n\nconst logFilterApply = action('onFilterApply');\nconst logFilterReset = action('onFilterReset');\n\nconst BASE_ITEMS: QueryListItem<TutorialHistoryRow>[] = [\n {\n id: 1,\n title: 'Getting started with YQL',\n query: QUERY,\n height: 28,\n },\n {\n id: 2,\n title: 'Working with tables',\n query: QUERY,\n height: 28,\n },\n {\n id: 3,\n title: 'Window functions',\n query: QUERY,\n height: 28,\n },\n];\n\nconst meta: Meta<typeof TutorialsHistory> = {\n title: 'Widgets/TutorialsHistory',\n component: TutorialsHistory,\n tags: ['autodocs'],\n parameters: {\n layout: 'padded',\n },\n};\n\nexport default meta;\ntype Story = StoryObj<typeof TutorialsHistory>;\n\nconst DefaultStory = () => {\n const [items, setItems] = useState([...BASE_ITEMS]);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n const handleOnSearch = (data: {value: string; fullSearch: boolean}) => {\n setSearch(data);\n\n if (!data.value) {\n setItems(BASE_ITEMS);\n return;\n }\n\n const newItems = BASE_ITEMS.filter((item) => {\n if (!('id' in item)) return false;\n\n const title = item.title.toLowerCase();\n const query = item.query?.toLowerCase();\n const searchValue = data.value.toLowerCase();\n\n if (data.fullSearch) {\n return title.includes(searchValue) || query?.includes(searchValue);\n }\n\n return title.includes(searchValue);\n });\n setItems(newItems);\n };\n\n return (\n <div style={{width: 300, height: 500}}>\n <TutorialsHistory\n title=\"Tutorials\"\n items={items}\n filter={{\n fields: filterFields,\n onApply: logFilterApply,\n onReset: logFilterReset('reset'),\n }}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: handleOnSearch,\n }}\n />\n </div>\n );\n};\n\nconst EmptyStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 300, height: 500}}>\n <TutorialsHistory\n title=\"Tutorials\"\n items={[]}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: setSearch,\n }}\n />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <DefaultStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAGC,QAAQ,QAAO,OAAO;AAErC,SAAQC,gBAAgB;AAGxB,SAAQC,MAAM,QAAO,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,IAAMC,KAAK,6IAKmC;AAE9C,IAAMC,YAA6C,GAAG,CAClD;EAACC,EAAE,EAAE,UAAU;EAAEC,IAAI,EAAE,QAAQ;EAAEC,KAAK,EAAE,iBAAiB;EAAEC,YAAY,EAAE;AAAI,CAAC,EAC9E;EAACH,EAAE,EAAE,OAAO;EAAEC,IAAI,EAAE,iBAAiB;EAAEC,KAAK,EAAE;AAAQ,CAAC,EACvD;EACIF,EAAE,EAAE,SAAS;EACbC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,SAAS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;MACnC,CAAE;MACFmB,MAAM,EAAE;QACJH,KAAK,EAAEG,MAAM,CAACH,KAAK;QACnBC,UAAU,EAAEE,MAAM,CAACF,UAAU;QAC7BmB,QAAQ,EAAE,IAAI;QACdC,QAAQ,EAAEhB;MACd;IAAE,CACL;EAAC,CACD,CAAC;AAEd,CAAC;AAED,IAAMiB,UAAU,GAAG,SAAbA,UAAUA,CAAA,EAAS;EACrB,IAAAC,UAAA,GAA4BpD,QAAQ,CAAC;MAAC6B,KAAK,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAC,CAAC;IAAAuB,UAAA,GAAA3B,cAAA,CAAA0B,UAAA;IAA7DpB,MAAM,GAAAqB,UAAA;IAAEpB,SAAS,GAAAoB,UAAA;EAExB,oBACIjD,IAAA;IAAKuC,KAAK,EAAE;MAACC,KAAK,EAAE,GAAG;MAAE5B,MAAM,EAAE;IAAG,CAAE;IAAA6B,QAAA,eAClCzC,IAAA,CAACH,gBAAgB;MACbQ,KAAK,EAAC,WAAW;MACjBE,KAAK,EAAE,EAAG;MACVqB,MAAM,EAAE;QACJH,KAAK,EAAEG,MAAM,CAACH,KAAK;QACnBC,UAAU,EAAEE,MAAM,CAACF,UAAU;QAC7BmB,QAAQ,EAAE,IAAI;QACdC,QAAQ,EAAEjB;MACd;IAAE,CACL;EAAC,CACD,CAAC;AAEd,CAAC;AAED,OAAO,IAAMqB,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQnD,IAAA,CAACkB,YAAY,IAAE,CAAC;EAAA;AAAA,CAAC;AAC9D,OAAO,IAAMkC,KAAY,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQnD,IAAA,CAAC+C,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
@@ -1,5 +1,7 @@
1
1
  export { QueriesHistory } from './QueriesHistory';
2
2
  export type { QueriesHistoryProps } from './QueriesHistory';
3
+ export { SavedQueries } from './SavedQueries';
4
+ export type { SavedQueriesProps } from './SavedQueries';
3
5
  export { DashboardCharts } from './DashboardCharts';
4
6
  export { TutorialsHistory } from './TutorialsHistory';
5
7
  export type { TutorialsHistoryProps } from './TutorialsHistory';
@@ -1,4 +1,5 @@
1
1
  export { QueriesHistory } from "./QueriesHistory";
2
+ export { SavedQueries } from "./SavedQueries";
2
3
  export { DashboardCharts } from "./DashboardCharts";
3
4
  export { TutorialsHistory } from "./TutorialsHistory";
4
5
  export { QueriesNavigation, createTableDetailConfig, createNavigationDetailResolver } from "./QueriesNavigation";
@@ -1 +1 @@
1
- {"version":3,"names":["QueriesHistory","DashboardCharts","TutorialsHistory","QueriesNavigation","createTableDetailConfig","createNavigationDetailResolver"],"sources":["index.ts"],"sourcesContent":["export {QueriesHistory} from './QueriesHistory';\nexport type {QueriesHistoryProps} from './QueriesHistory';\nexport {DashboardCharts} from './DashboardCharts';\nexport {TutorialsHistory} from './TutorialsHistory';\nexport type {TutorialsHistoryProps} from './TutorialsHistory';\nexport {\n QueriesNavigation,\n createTableDetailConfig,\n createNavigationDetailResolver,\n} from './QueriesNavigation';\nexport type {\n QueriesNavigationProps,\n CreateTableDetailConfigOptions,\n NavigationPreviewResolver,\n NavigationSchemaResolver,\n} from './QueriesNavigation';\n"],"mappings":"AAAA,SAAQA,cAAc;AAEtB,SAAQC,eAAe;AACvB,SAAQC,gBAAgB;AAExB,SACIC,iBAAiB,EACjBC,uBAAuB,EACvBC,8BAA8B","ignoreList":[]}
1
+ {"version":3,"names":["QueriesHistory","SavedQueries","DashboardCharts","TutorialsHistory","QueriesNavigation","createTableDetailConfig","createNavigationDetailResolver"],"sources":["index.ts"],"sourcesContent":["export {QueriesHistory} from './QueriesHistory';\nexport type {QueriesHistoryProps} from './QueriesHistory';\nexport {SavedQueries} from './SavedQueries';\nexport type {SavedQueriesProps} from './SavedQueries';\nexport {DashboardCharts} from './DashboardCharts';\nexport {TutorialsHistory} from './TutorialsHistory';\nexport type {TutorialsHistoryProps} from './TutorialsHistory';\nexport {\n QueriesNavigation,\n createTableDetailConfig,\n createNavigationDetailResolver,\n} from './QueriesNavigation';\nexport type {\n QueriesNavigationProps,\n CreateTableDetailConfigOptions,\n NavigationPreviewResolver,\n NavigationSchemaResolver,\n} from './QueriesNavigation';\n"],"mappings":"AAAA,SAAQA,cAAc;AAEtB,SAAQC,YAAY;AAEpB,SAAQC,eAAe;AACvB,SAAQC,gBAAgB;AAExB,SACIC,iBAAiB,EACjBC,uBAAuB,EACvBC,8BAA8B","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/querieskit",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Query page component library",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -1,19 +1,21 @@
1
- import React, {KeyboardEvent, useState} from 'react';
2
- import {QueryHistoryEditingRenderData, QueryHistoryRow} from '../../types/history';
1
+ import React, {KeyboardEvent, useEffect, useState} from 'react';
3
2
  import {Text, TextInput} from '@gravity-ui/uikit';
4
- import './HistoryRow.scss';
3
+ import {QueryListEditingRenderData, QueryListRow} from '../../types/queryList';
5
4
 
6
- export type Props<T extends QueryHistoryRow> = {
5
+ export type EditableRowTitleProps<T extends QueryListRow = QueryListRow> = {
7
6
  item: T;
8
- editing?: QueryHistoryEditingRenderData<T>;
7
+ editing?: QueryListEditingRenderData<T>;
9
8
  };
10
9
 
11
- export const HistoryRowTitle = <T extends QueryHistoryRow>({item, editing}: Props<T>) => {
10
+ export const EditableRowTitle = <T extends QueryListRow>({
11
+ item,
12
+ editing,
13
+ }: EditableRowTitleProps<T>) => {
12
14
  const [title, setTitle] = useState(item.title);
13
15
  const isEditing = Boolean(editing?.enabled);
14
16
  const isTitleEmpty = !title.trim();
15
17
 
16
- React.useEffect(() => {
18
+ useEffect(() => {
17
19
  setTitle(item.title);
18
20
  }, [item.id, item.title]);
19
21
 
@@ -61,9 +63,5 @@ export const HistoryRowTitle = <T extends QueryHistoryRow>({item, editing}: Prop
61
63
  );
62
64
  }
63
65
 
64
- return (
65
- <Text variant="subheader-1" ellipsis>
66
- {item.title}
67
- </Text>
68
- );
66
+ return <Text ellipsis>{item.title}</Text>;
69
67
  };
@@ -0,0 +1,2 @@
1
+ export {EditableRowTitle} from './EditableRowTitle';
2
+ export type {EditableRowTitleProps} from './EditableRowTitle';
@@ -3,7 +3,7 @@ import {Button, Flex, Icon, Popup} from '@gravity-ui/uikit';
3
3
  import FunnelIcon from '@gravity-ui/icons/svgs/funnel.svg';
4
4
  import ArrowRotateLeftIcon from '@gravity-ui/icons/svgs/arrow-rotate-left.svg';
5
5
  import {useToggle} from '../../helpers/useToggle';
6
- import {QueryHistoryFilterConfig} from '../../types/history';
6
+ import {QueryListFilterConfig} from '../../types/queryList';
7
7
  import cn from 'bem-cn-lite';
8
8
  import {SimpleForm} from '../SimpleForm';
9
9
  import i18n from './i18n';
@@ -11,7 +11,7 @@ import './HistoryFilter.scss';
11
11
 
12
12
  const block = cn('qp-history-filter');
13
13
 
14
- export const HistoryFilter: FC<QueryHistoryFilterConfig> = ({
14
+ export const HistoryFilter: FC<QueryListFilterConfig> = ({
15
15
  fields = [],
16
16
  values,
17
17
  initialValues,
@@ -2,12 +2,12 @@
2
2
  .g-list__item_selected:hover {
3
3
  background-color: var(--g-color-base-selection-hover);
4
4
  }
5
- }
6
5
 
7
- .qp-lazy-list__sentinel {
8
- height: 1px;
9
- }
6
+ &__sentinel {
7
+ height: 1px;
8
+ }
10
9
 
11
- .qp-lazy-list__spinner {
12
- height: 100%;
10
+ &__spinner {
11
+ height: 100%;
12
+ }
13
13
  }
@@ -0,0 +1,47 @@
1
+ import React, {MouseEvent, useMemo} from 'react';
2
+ import {Button, DropdownMenu, DropdownMenuItem, Icon} from '@gravity-ui/uikit';
3
+ import EllipsisIcon from '@gravity-ui/icons/svgs/ellipsis.svg';
4
+ import {QueryListRow, QueryListRowAction} from '../../types/queryList';
5
+
6
+ export type RowActionsMenuProps<T extends QueryListRow = QueryListRow> = {
7
+ item: T;
8
+ actions?: QueryListRowAction<T>[];
9
+ };
10
+
11
+ export const RowActionsMenu = <T extends QueryListRow>({item, actions}: RowActionsMenuProps<T>) => {
12
+ const items = useMemo(() => {
13
+ return actions?.map<DropdownMenuItem>(({icon, text, theme, hidden, disabled, onClick}) => {
14
+ return {
15
+ text,
16
+ theme,
17
+ hidden,
18
+ disabled,
19
+ iconStart: icon,
20
+ action: () => {
21
+ onClick(item);
22
+ },
23
+ };
24
+ });
25
+ }, [actions, item]);
26
+
27
+ if (!actions?.length) return null;
28
+
29
+ const handleClick = (event: MouseEvent<HTMLDivElement>) => {
30
+ event.preventDefault();
31
+ event.stopPropagation();
32
+ };
33
+
34
+ return (
35
+ <div onClick={handleClick}>
36
+ <DropdownMenu
37
+ size="s"
38
+ renderSwitcher={(props) => (
39
+ <Button {...props} size="xs">
40
+ <Icon data={EllipsisIcon} size={12} />
41
+ </Button>
42
+ )}
43
+ items={items}
44
+ />
45
+ </div>
46
+ );
47
+ };
@@ -0,0 +1,2 @@
1
+ export {RowActionsMenu} from './RowActionsMenu';
2
+ export type {RowActionsMenuProps} from './RowActionsMenu';
@@ -14,6 +14,10 @@ export {HistoryFilter} from './HistoryFilter';
14
14
  export {HistoryPrivateIcon} from './HistoryPrivateIcon';
15
15
  export {FieldsSelector} from './FieldsSelector';
16
16
  export type {FieldsSelectorOption, FieldsSelectorProps} from './FieldsSelector';
17
+ export {EditableRowTitle} from './EditableRowTitle';
18
+ export type {EditableRowTitleProps} from './EditableRowTitle';
19
+ export {RowActionsMenu} from './RowActionsMenu';
20
+ export type {RowActionsMenuProps} from './RowActionsMenu';
17
21
  export {FieldsSearchToolbar} from './FieldsSearchToolbar';
18
22
  export type {FieldsSearchToolbarProps} from './FieldsSearchToolbar';
19
23
  export {HistoryGroupHeader} from './HistoryGroupHeader';
@@ -1,8 +1,8 @@
1
- import {BaseHistoryRow, QueryHistoryItem, QueryHistoryRowVariant} from '../types/history';
1
+ import {QueryListItem, QueryListRow, QueryListRowVariant} from '../types/queryList';
2
2
 
3
- export const getListKey = <T extends BaseHistoryRow>(
4
- items: QueryHistoryItem<T>[],
5
- variant: QueryHistoryRowVariant,
3
+ export const getListKey = <T extends QueryListRow>(
4
+ items: QueryListItem<T>[],
5
+ variant: QueryListRowVariant,
6
6
  ): string => {
7
7
  const itemsKey = items
8
8
  .map((item) => ('header' in item ? `h:${item.header}` : `r:${item.id}`))
@@ -1,4 +1,5 @@
1
- import {QueryHistoryFieldKey, QueryHistoryRow} from '../types/history';
1
+ import {QueryListFieldKey} from '../types/queryList';
2
+ import {QueryHistoryRow} from '../types/history';
2
3
 
3
4
  /**
4
5
  * A field is visible either when no `visibleFields` config is provided
@@ -6,14 +7,14 @@ import {QueryHistoryFieldKey, QueryHistoryRow} from '../types/history';
6
7
  * the field key is explicitly included in `visibleFields.value`.
7
8
  *
8
9
  * `visibleFields` is accepted loosely as `{value: string[]}` (rather than the
9
- * generic `QueryHistoryVisibleFieldsConfig<T>`) so this helper works for any
10
+ * generic `QueryListVisibleFieldsConfig<T>`) so this helper works for any
10
11
  * `T extends QueryHistoryRow` without fighting TS variance on generic key
11
- * unions; `field` still uses `QueryHistoryFieldKey<QueryHistoryRow>` to keep
12
+ * unions; `field` still uses `QueryListFieldKey<QueryHistoryRow>` to keep
12
13
  * typo-protection for the built-in fields checked by the row renderers.
13
14
  */
14
15
  export const isFieldVisible = (
15
16
  visibleFields: {value: string[]} | undefined,
16
- field: QueryHistoryFieldKey<QueryHistoryRow>,
17
+ field: QueryListFieldKey<QueryHistoryRow>,
17
18
  ): boolean => {
18
19
  return visibleFields === undefined || visibleFields.value.includes(field);
19
20
  };
@@ -20,6 +20,10 @@ export const formatTimeCanonical = (ts: Date) => {
20
20
  return dateTimeParse(ts)?.format('DD.MM.YYYY, HH:mm');
21
21
  };
22
22
 
23
+ export const formatDateCanonical = (ts: Date) => {
24
+ return dateTimeParse(ts)?.format('DD.MM.YYYY');
25
+ };
26
+
23
27
  export const getTimestampFromDate = (date: Date) => {
24
28
  return dateTimeParse(date)?.valueOf();
25
29
  };
package/src/index.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from './components';
2
2
  export * from './modules';
3
3
  export * from './widgets';
4
+ export * from './types/queryList';
4
5
  export * from './types/history';
6
+ export type {SavedQuery} from './types/savedQueries';
5
7
  export * from './types/tutorial';
6
8
  export * from './types/navigation';
7
9
  export * from './types/pathEditor';
@@ -1,4 +1,4 @@
1
- .qp-query-history-comparison-action {
1
+ .qp-history-comparison-actions {
2
2
  padding: 12px 20px;
3
3
  background: var(--g-color-base-background);
4
- }
4
+ }
@@ -1,22 +1,22 @@
1
1
  import React from 'react';
2
2
  import {Button, Flex, Icon} from '@gravity-ui/uikit';
3
- import {QueryHistoryComparisonConfig, QueryHistoryRow} from '../../types/history';
4
- import ArrowRotateRightIcon from '@gravity-ui/icons/svgs/arrow-rotate-right.svg';
5
3
  import ArrowRightArrowLeftIcon from '@gravity-ui/icons/svgs/arrow-right-arrow-left.svg';
6
- import './ComparisonActions.scss';
4
+ import ArrowRotateRightIcon from '@gravity-ui/icons/svgs/arrow-rotate-right.svg';
5
+ import {QueryListComparisonConfig, QueryListRow} from '../../types/queryList';
7
6
  import cn from 'bem-cn-lite';
7
+ import './HistoryComparisonActions.scss';
8
8
 
9
- type Props<T extends QueryHistoryRow> = {
10
- comparison: QueryHistoryComparisonConfig<T>;
9
+ export type HistoryComparisonActionsProps<T extends QueryListRow = QueryListRow> = {
10
+ comparison: QueryListComparisonConfig<T>;
11
11
  className?: string;
12
12
  };
13
13
 
14
- const block = cn('qp-query-history-comparison-action');
14
+ const block = cn('qp-history-comparison-actions');
15
15
 
16
- export const ComparisonActions = <T extends QueryHistoryRow>({
16
+ export const HistoryComparisonActions = <T extends QueryListRow>({
17
17
  comparison: {enabled, comparedRowIds, onCompare, onCancel},
18
18
  className,
19
- }: Props<T>) => {
19
+ }: HistoryComparisonActionsProps<T>) => {
20
20
  if (!enabled) return null;
21
21
 
22
22
  return (
@@ -0,0 +1,2 @@
1
+ export {HistoryComparisonActions} from './HistoryComparisonActions';
2
+ export type {HistoryComparisonActionsProps} from './HistoryComparisonActions';
@@ -1,13 +1,13 @@
1
1
  import React, {FC, useEffect, useState} from 'react';
2
2
  import {FullSearchToggleButton} from './internal/FullSearchToggleButton';
3
3
  import {HistoryFilter, SearchWithButtons} from '../../components';
4
- import {QueryHistoryFilterConfig} from '../../types/history';
4
+ import {QueryListFilterConfig} from '../../types/queryList';
5
5
 
6
6
  type Props = {
7
7
  search?: string;
8
8
  fullSearch?: boolean;
9
9
  hasClear?: boolean;
10
- filter?: QueryHistoryFilterConfig;
10
+ filter?: QueryListFilterConfig;
11
11
  onUpdate: (data: {value: string; fullSearch: boolean}) => void;
12
12
  className?: string;
13
13
  };
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import type {Meta, StoryObj} from '@storybook/react';
3
3
  import {HistoryRow} from './HistoryRow';
4
- import {QueryHistoryRow, QueryHistoryRowAction} from '../../types/history';
4
+ import {QueryListRowAction} from '../../types/queryList';
5
+ import {QueryHistoryRow} from '../../types/history';
5
6
 
6
7
  const now = Date.now();
7
8
  const min = 60 * 1000;
@@ -19,7 +20,7 @@ const makeRow = (overrides: Partial<QueryHistoryRow>): QueryHistoryRow => ({
19
20
  ...overrides,
20
21
  });
21
22
 
22
- const defaultActions: Array<QueryHistoryRowAction<QueryHistoryRow>> = [
23
+ const defaultActions: Array<QueryListRowAction<QueryHistoryRow>> = [
23
24
  {text: 'Run again', onClick: (row) => alert(`Run: ${row.title}`)},
24
25
  {text: 'Copy', onClick: (row) => alert(`Copy: ${row.title}`)},
25
26
  {text: 'Delete', onClick: (row) => alert(`Delete: ${row.title}`)},
@@ -1,17 +1,23 @@
1
1
  import React from 'react';
2
- import {QueryHistoryRow, QueryHistoryRowRenderData} from '../../types/history';
2
+ import {QueryListRowRenderData} from '../../types/queryList';
3
+ import {QueryHistoryRow} from '../../types/history';
3
4
  import {Flex, Text} from '@gravity-ui/uikit';
4
5
  import './HistoryRow.scss';
5
6
  import cn from 'bem-cn-lite';
6
- import {HistoryPrivateIcon, QueryDuration, QueryStatusIcon, RowLink} from '../../components';
7
+ import {
8
+ EditableRowTitle,
9
+ HistoryPrivateIcon,
10
+ QueryDuration,
11
+ QueryStatusIcon,
12
+ RowActionsMenu,
13
+ RowLink,
14
+ } from '../../components';
7
15
  import {formatTime} from '../../helpers/time';
8
16
  import {isFieldVisible} from '../../helpers/isFieldVisible';
9
- import {HistoryRowTitle} from './HistoryRowTitle';
10
- import {HistoryRowMenu} from './HistoryRowMenu';
11
17
 
12
18
  export type Props<T extends QueryHistoryRow> = {
13
19
  item: T;
14
- } & Omit<QueryHistoryRowRenderData<T>, 'item' | 'variant'>;
20
+ } & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;
15
21
 
16
22
  const block = cn('qp-history-row');
17
23
 
@@ -38,8 +44,8 @@ export const HistoryRow = <T extends QueryHistoryRow>({
38
44
  <QueryStatusIcon status={status} />
39
45
  <Flex direction="column" gap={1} className={block('right-column')}>
40
46
  <Flex justifyContent="space-between" className={block('header')}>
41
- <HistoryRowTitle item={item} editing={editing} />
42
- {showMenu && <HistoryRowMenu item={item} actions={actions} />}
47
+ <EditableRowTitle item={item} editing={editing} />
48
+ {showMenu && <RowActionsMenu item={item} actions={actions} />}
43
49
  </Flex>
44
50
  <div className={block('data')}>
45
51
  {isFieldVisible(visibleFields, 'duration') && startTime && (
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import {Flex, Text} from '@gravity-ui/uikit';
3
- import {QueryHistoryRow, QueryHistoryRowRenderData} from '../../types/history';
3
+ import {QueryListRowRenderData} from '../../types/queryList';
4
+ import {QueryHistoryRow} from '../../types/history';
4
5
  import {
5
6
  HistoryPrivateIcon,
6
7
  QueryDuration,
@@ -17,7 +18,7 @@ const block = cn('qp-history-search-row');
17
18
 
18
19
  export type Props<T extends QueryHistoryRow> = {
19
20
  item: T;
20
- } & Omit<QueryHistoryRowRenderData<T>, 'item' | 'variant'>;
21
+ } & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;
21
22
 
22
23
  export const HistorySearchRow = <T extends QueryHistoryRow>({
23
24
  item,
@@ -28,11 +28,7 @@ export const NavigationItemsListHeader: FC<NavigationItemsListHeaderProps> = ({
28
28
  className,
29
29
  }) => {
30
30
  if (!onSortUpdate) {
31
- return (
32
- <Flex alignItems="center" className={block(null, className)}>
33
- <Text>{titleLabel}</Text>
34
- </Flex>
35
- );
31
+ return null;
36
32
  }
37
33
 
38
34
  const handleClick = () => {
@@ -0,0 +1,10 @@
1
+ .qp-queries-list {
2
+ height: 100%;
3
+
4
+ &__comparison-actions {
5
+ position: absolute;
6
+ left: 0;
7
+ bottom: 0;
8
+ width: 100%;
9
+ }
10
+ }