@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,98 @@
1
+ import React from 'react';
2
+ import cn from 'bem-cn-lite';
3
+ import {FieldsSelector} from '../../components';
4
+ import {getListKey} from '../../helpers/getListKey';
5
+ import {
6
+ QueryListComparisonConfig,
7
+ QueryListEditingConfig,
8
+ QueryListFilterConfig,
9
+ QueryListItem,
10
+ QueryListRow,
11
+ QueryListRowAction,
12
+ QueryListRowRenderData,
13
+ QueryListSearchConfig,
14
+ QueryListVisibleFieldsConfig,
15
+ } from '../../types/queryList';
16
+ import {HistoryComparisonActions} from '../HistoryComparisonActions';
17
+ import {HistoryHeader} from '../HistoryHeader';
18
+ import {HistoryLayout} from '../HistoryLayout';
19
+ import {RowsList} from '../RowsList';
20
+ import './QueriesList.scss';
21
+
22
+ const block = cn('qp-queries-list');
23
+
24
+ export type QueriesListProps<T extends QueryListRow> = {
25
+ className?: string;
26
+ title: React.ReactNode;
27
+ logo?: React.ReactNode;
28
+ search: QueryListSearchConfig;
29
+ filter?: QueryListFilterConfig;
30
+ items: QueryListItem<T>[];
31
+ selectedRowId?: T['id'];
32
+ editing?: QueryListEditingConfig<T>;
33
+ comparison?: QueryListComparisonConfig<T>;
34
+ visibleFields?: QueryListVisibleFieldsConfig<T>;
35
+ getRowActions?: (item: T) => QueryListRowAction<T>[];
36
+ renderRow: (data: QueryListRowRenderData<T>) => React.ReactNode;
37
+ onListItemClick?: (item: QueryListItem<T>) => void;
38
+ };
39
+
40
+ export const QueriesList = <T extends QueryListRow>({
41
+ title,
42
+ logo,
43
+ search,
44
+ filter,
45
+ items,
46
+ selectedRowId,
47
+ editing,
48
+ comparison,
49
+ visibleFields,
50
+ getRowActions,
51
+ renderRow,
52
+ onListItemClick,
53
+ className,
54
+ }: QueriesListProps<T>) => {
55
+ const showSearchResults = Boolean(search.fullSearch && search.value?.trim());
56
+ const rowVariant = showSearchResults ? 'search' : 'default';
57
+
58
+ return (
59
+ <HistoryLayout
60
+ className={block(null, className)}
61
+ title={title}
62
+ logo={logo}
63
+ actions={visibleFields && <FieldsSelector {...visibleFields} />}
64
+ header={
65
+ <HistoryHeader
66
+ className={block('header')}
67
+ search={search.value}
68
+ fullSearch={search.fullSearch}
69
+ hasClear={search.hasClear}
70
+ filter={filter}
71
+ onUpdate={search.onUpdate}
72
+ />
73
+ }
74
+ footer={
75
+ comparison && (
76
+ <HistoryComparisonActions
77
+ comparison={comparison}
78
+ className={block('comparison-actions')}
79
+ />
80
+ )
81
+ }
82
+ >
83
+ <RowsList
84
+ key={getListKey(items, rowVariant)}
85
+ items={items}
86
+ rowVariant={rowVariant}
87
+ selectedRowId={selectedRowId}
88
+ visibleFields={visibleFields}
89
+ editing={editing}
90
+ comparison={comparison}
91
+ getRowActions={getRowActions}
92
+ renderRow={renderRow}
93
+ showFiltersHint={Boolean(filter)}
94
+ onItemClick={onListItemClick}
95
+ />
96
+ </HistoryLayout>
97
+ );
98
+ };
@@ -0,0 +1,2 @@
1
+ export {QueriesList} from './QueriesList';
2
+ export type {QueriesListProps} from './QueriesList';
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
2
  import cn from 'bem-cn-lite';
3
3
  import {
4
- BaseHistoryRow,
5
- QueryHistoryComparisonConfig,
6
- QueryHistoryEditingConfig,
7
- QueryHistoryItem,
8
- QueryHistoryRowAction,
9
- QueryHistoryRowRenderData,
10
- QueryHistoryRowVariant,
11
- QueryHistoryVisibleFieldsConfig,
12
- } from '../../types/history';
4
+ QueryListComparisonConfig,
5
+ QueryListEditingConfig,
6
+ QueryListItem,
7
+ QueryListRow,
8
+ QueryListRowAction,
9
+ QueryListRowRenderData,
10
+ QueryListRowVariant,
11
+ QueryListVisibleFieldsConfig,
12
+ } from '../../types/queryList';
13
13
  import {EmptyContent, LazyList} from '../../components';
14
14
  import {prepareRowData} from './helpers/prepareRowData';
15
15
  import {SEARCH_ROW_HEIGHT} from '../../constants/row';
@@ -17,21 +17,21 @@ import './RowsList.scss';
17
17
 
18
18
  const block = cn('qp-rows-list');
19
19
 
20
- export type RowsListProps<T extends BaseHistoryRow> = {
21
- items: QueryHistoryItem<T>[];
20
+ export type RowsListProps<T extends QueryListRow> = {
21
+ items: QueryListItem<T>[];
22
22
  selectedRowId?: T['id'];
23
- rowVariant?: QueryHistoryRowVariant;
24
- visibleFields?: QueryHistoryVisibleFieldsConfig<T>;
25
- editing?: QueryHistoryEditingConfig<T>;
26
- comparison?: QueryHistoryComparisonConfig<T>;
27
- getRowActions?: (item: T) => QueryHistoryRowAction<T>[];
28
- renderRow: (data: QueryHistoryRowRenderData<T>) => React.ReactNode;
23
+ rowVariant?: QueryListRowVariant;
24
+ visibleFields?: QueryListVisibleFieldsConfig<T>;
25
+ editing?: QueryListEditingConfig<T>;
26
+ comparison?: QueryListComparisonConfig<T>;
27
+ getRowActions?: (item: T) => QueryListRowAction<T>[];
28
+ renderRow: (data: QueryListRowRenderData<T>) => React.ReactNode;
29
29
  showFiltersHint?: boolean;
30
30
  className?: string;
31
- onItemClick?: (item: QueryHistoryItem<T>, index: number) => void;
31
+ onItemClick?: (item: QueryListItem<T>, index: number) => void;
32
32
  };
33
33
 
34
- export const RowsList = <T extends BaseHistoryRow>({
34
+ export const RowsList = <T extends QueryListRow>({
35
35
  items,
36
36
  selectedRowId,
37
37
  rowVariant = 'default',
@@ -44,10 +44,14 @@ export const RowsList = <T extends BaseHistoryRow>({
44
44
  className,
45
45
  onItemClick,
46
46
  }: RowsListProps<T>) => {
47
- const getItemHeight = (item: QueryHistoryItem<T>) =>
47
+ const getItemHeight = (item: QueryListItem<T>) =>
48
48
  rowVariant === 'search' && !('header' in item) ? SEARCH_ROW_HEIGHT : item.height;
49
+ const selectedItemIndex =
50
+ selectedRowId === undefined
51
+ ? undefined
52
+ : items.findIndex((item) => !('header' in item) && item.id === selectedRowId);
49
53
 
50
- const handleItemClick = (item: QueryHistoryItem<T>, index: number) => {
54
+ const handleItemClick = (item: QueryListItem<T>, index: number) => {
51
55
  if ('header' in item || !comparison?.enabled) {
52
56
  onItemClick?.(item, index);
53
57
  return;
@@ -67,7 +71,7 @@ export const RowsList = <T extends BaseHistoryRow>({
67
71
  }
68
72
 
69
73
  return (
70
- <LazyList<QueryHistoryItem<T>>
74
+ <LazyList<QueryListItem<T>>
71
75
  className={block(null, className)}
72
76
  items={items}
73
77
  itemHeight={getItemHeight}
@@ -85,7 +89,7 @@ export const RowsList = <T extends BaseHistoryRow>({
85
89
  }),
86
90
  )
87
91
  }
88
- selectedItemIndex={selectedRowId}
92
+ selectedItemIndex={selectedItemIndex}
89
93
  onItemClick={handleItemClick}
90
94
  />
91
95
  );
@@ -1,26 +1,26 @@
1
1
  import {
2
- BaseHistoryRow,
3
- QueryHistoryComparisonConfig,
4
- QueryHistoryEditingConfig,
5
- QueryHistoryItem,
6
- QueryHistoryRowAction,
7
- QueryHistoryRowRenderData,
8
- QueryHistoryRowVariant,
9
- QueryHistoryVisibleFieldsConfig,
10
- } from '../../../types/history';
2
+ QueryListComparisonConfig,
3
+ QueryListEditingConfig,
4
+ QueryListItem,
5
+ QueryListRow,
6
+ QueryListRowAction,
7
+ QueryListRowRenderData,
8
+ QueryListRowVariant,
9
+ QueryListVisibleFieldsConfig,
10
+ } from '../../../types/queryList';
11
11
 
12
- type Props<T extends BaseHistoryRow> = {
13
- item: QueryHistoryItem<T>;
12
+ type Props<T extends QueryListRow> = {
13
+ item: QueryListItem<T>;
14
14
  isActive: boolean;
15
15
  index: number;
16
- variant: QueryHistoryRowVariant;
17
- visibleFields?: QueryHistoryVisibleFieldsConfig<T>;
18
- editing?: QueryHistoryEditingConfig<T>;
19
- comparison?: QueryHistoryComparisonConfig<T>;
20
- getRowActions?: (item: T) => QueryHistoryRowAction<T>[];
16
+ variant: QueryListRowVariant;
17
+ visibleFields?: QueryListVisibleFieldsConfig<T>;
18
+ editing?: QueryListEditingConfig<T>;
19
+ comparison?: QueryListComparisonConfig<T>;
20
+ getRowActions?: (item: T) => QueryListRowAction<T>[];
21
21
  };
22
22
 
23
- export const prepareRowData = <T extends BaseHistoryRow>({
23
+ export const prepareRowData = <T extends QueryListRow>({
24
24
  item,
25
25
  isActive,
26
26
  index,
@@ -29,7 +29,7 @@ export const prepareRowData = <T extends BaseHistoryRow>({
29
29
  editing,
30
30
  comparison,
31
31
  getRowActions,
32
- }: Props<T>): QueryHistoryRowRenderData<T> => {
32
+ }: Props<T>): QueryListRowRenderData<T> => {
33
33
  const isRow = !('header' in item);
34
34
  const actions = isRow && getRowActions ? getRowActions(item) : undefined;
35
35
  const editingData =
@@ -0,0 +1,20 @@
1
+ .qp-saved-query-row {
2
+ height: 100%;
3
+
4
+ &_compared {
5
+ background-color: var(--g-color-base-utility-light);
6
+ }
7
+
8
+ &__content {
9
+ min-width: 0;
10
+ }
11
+
12
+ &__header {
13
+ height: 20px;
14
+ min-width: 0;
15
+ }
16
+
17
+ &__metadata {
18
+ min-width: 0;
19
+ }
20
+ }
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import {Avatar, Flex, Text} from '@gravity-ui/uikit';
3
+ import cn from 'bem-cn-lite';
4
+ import {EditableRowTitle, RowActionsMenu, RowLink} from '../../components';
5
+ import {formatDateCanonical} from '../../helpers/time';
6
+ import {QueryListRowRenderData} from '../../types/queryList';
7
+ import {SavedQuery} from '../../types/savedQueries';
8
+ import './SavedQueryRow.scss';
9
+
10
+ const block = cn('qp-saved-query-row');
11
+
12
+ export type SavedQueryRowProps<T extends SavedQuery = SavedQuery> = {
13
+ item: T;
14
+ renderAuthor?: (item: T) => React.ReactNode;
15
+ } & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;
16
+
17
+ export const SavedQueryRow = <T extends SavedQuery>({
18
+ item,
19
+ actions,
20
+ isActive,
21
+ comparison,
22
+ editing,
23
+ visibleFields,
24
+ renderAuthor,
25
+ }: SavedQueryRowProps<T>) => {
26
+ const {author, engine, href, savedAt} = item;
27
+ const isEditing = Boolean(editing?.enabled);
28
+ const isComparisonMode = Boolean(comparison?.enabled);
29
+ const isChecked = Boolean(comparison?.checked);
30
+ const showMenu = isActive && Boolean(actions?.length) && !isComparisonMode;
31
+ const isFieldVisible = (field: string) =>
32
+ visibleFields === undefined || (visibleFields.value as string[]).includes(field);
33
+ const authorContent =
34
+ renderAuthor?.(item) ??
35
+ (author ? <Avatar size="3xs" text={author} title={author} /> : null);
36
+
37
+ return (
38
+ <RowLink
39
+ href={href}
40
+ disabled={isEditing || isComparisonMode}
41
+ className={block({compared: isChecked})}
42
+ >
43
+ <Flex direction="column" gap={1} className={block('content')}>
44
+ <Flex justifyContent="space-between" className={block('header')}>
45
+ <EditableRowTitle item={item} editing={editing} />
46
+ {showMenu && <RowActionsMenu item={item} actions={actions} />}
47
+ </Flex>
48
+ <Flex gap={2} alignItems="center" className={block('metadata')}>
49
+ {isFieldVisible('savedAt') && savedAt && (
50
+ <Text color="complementary">{formatDateCanonical(savedAt)}</Text>
51
+ )}
52
+ {isFieldVisible('engine') && engine && (
53
+ <Text color="complementary">{engine}</Text>
54
+ )}
55
+ {isFieldVisible('author') && authorContent}
56
+ </Flex>
57
+ </Flex>
58
+ </RowLink>
59
+ );
60
+ };
@@ -0,0 +1,2 @@
1
+ export {SavedQueryRow} from './SavedQueryRow';
2
+ export type {SavedQueryRowProps} from './SavedQueryRow';
@@ -0,0 +1,15 @@
1
+ .qp-saved-query-search-row {
2
+ &__header {
3
+ min-width: 0;
4
+ width: 100%;
5
+ }
6
+
7
+ &__title {
8
+ flex: 1;
9
+ min-width: 0;
10
+ }
11
+
12
+ &__fixed-metadata {
13
+ flex-shrink: 0;
14
+ }
15
+ }
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import {Avatar, Flex, Text} from '@gravity-ui/uikit';
3
+ import cn from 'bem-cn-lite';
4
+ import {MonacoLanguage, SearchRowLayout} from '../../components';
5
+ import {formatDateCanonical} from '../../helpers/time';
6
+ import {QueryListRowRenderData} from '../../types/queryList';
7
+ import {SavedQuery} from '../../types/savedQueries';
8
+ import './SavedQuerySearchRow.scss';
9
+
10
+ const block = cn('qp-saved-query-search-row');
11
+
12
+ export type SavedQuerySearchRowProps<T extends SavedQuery = SavedQuery> = {
13
+ item: T;
14
+ renderAuthor?: (item: T) => React.ReactNode;
15
+ } & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;
16
+
17
+ export const SavedQuerySearchRow = <T extends SavedQuery>({
18
+ item,
19
+ comparison,
20
+ editing,
21
+ visibleFields,
22
+ renderAuthor,
23
+ }: SavedQuerySearchRowProps<T>) => {
24
+ const {author, engine, href, query, savedAt} = item;
25
+ const authorContent =
26
+ renderAuthor?.(item) ??
27
+ (author ? <Avatar size="3xs" text={author} title={author} /> : null);
28
+ const isFieldVisible = (field: string) =>
29
+ visibleFields === undefined || (visibleFields.value as string[]).includes(field);
30
+
31
+ return (
32
+ <SearchRowLayout
33
+ query={query}
34
+ language={MonacoLanguage.YQL}
35
+ href={href}
36
+ disabled={Boolean(editing?.enabled) || Boolean(comparison?.enabled)}
37
+ className={block()}
38
+ header={
39
+ <Flex gap={2} alignItems="center" className={block('header')}>
40
+ <Text variant="subheader-1" ellipsis className={block('title')}>
41
+ {item.title}
42
+ </Text>
43
+ {isFieldVisible('savedAt') && savedAt && (
44
+ <Text color="complementary" className={block('fixed-metadata')}>
45
+ {formatDateCanonical(savedAt)}
46
+ </Text>
47
+ )}
48
+ {isFieldVisible('engine') && engine && (
49
+ <Text color="complementary" className={block('fixed-metadata')}>
50
+ {engine}
51
+ </Text>
52
+ )}
53
+ {isFieldVisible('author') && authorContent}
54
+ </Flex>
55
+ }
56
+ />
57
+ );
58
+ };
@@ -0,0 +1,2 @@
1
+ export {SavedQuerySearchRow} from './SavedQuerySearchRow';
2
+ export type {SavedQuerySearchRowProps} from './SavedQuerySearchRow';
@@ -1,14 +1,20 @@
1
1
  export {HistoryHeader} from './HistoryHeader';
2
2
  export {HistoryLayout} from './HistoryLayout';
3
+ export {HistoryComparisonActions} from './HistoryComparisonActions';
4
+ export type {HistoryComparisonActionsProps} from './HistoryComparisonActions';
3
5
  export {NavigationHeader} from './NavigationHeader';
4
6
  export type {NavigationHeaderProps} from './NavigationHeader';
5
7
  export type {HistoryLayoutProps} from './HistoryLayout';
6
8
  export {RowsList} from './RowsList';
7
9
  export type {RowsListProps} from './RowsList';
10
+ export {QueriesList} from './QueriesList';
11
+ export type {QueriesListProps} from './QueriesList';
8
12
  export {HistoryRow} from './HistoryRow';
9
- export {HistoryList} from './HistoryList';
10
- export type {HistoryListProps} from './HistoryList';
11
13
  export {HistorySearchRow} from './HistorySearchRow';
14
+ export {SavedQueryRow} from './SavedQueryRow';
15
+ export type {SavedQueryRowProps} from './SavedQueryRow';
16
+ export {SavedQuerySearchRow} from './SavedQuerySearchRow';
17
+ export type {SavedQuerySearchRowProps} from './SavedQuerySearchRow';
12
18
  export * from './ChartEditor';
13
19
  export {TutorialRow} from './TutorialRow';
14
20
  export type {TutorialRowProps} from './TutorialRow';
@@ -1,103 +1,12 @@
1
- import {ReactNode} from 'react';
2
- import {RegisteredFormFields} from './forms';
1
+ import {QueryListRow, QueryTimestamp} from './queryList';
3
2
 
4
3
  export type QueryStatus = 'completed' | 'failed' | 'aborted' | 'draft' | 'running';
5
4
 
6
- /** ISO 8601 date string or Unix timestamp in milliseconds. */
7
- export type QueryHistoryTimestamp = string | number;
8
-
9
- export type HistoryRowRenderProps = {height: number};
10
-
11
- export type QueryHistoryHeader = {header: string} & HistoryRowRenderProps;
12
-
13
- export type BaseHistoryRow = {
14
- id: number;
15
- title: string;
16
- query?: string;
17
- href?: string;
18
- } & HistoryRowRenderProps;
19
-
20
- export type QueryHistoryRow = BaseHistoryRow & {
21
- startTime?: QueryHistoryTimestamp;
22
- endTime?: QueryHistoryTimestamp;
5
+ export type QueryHistoryRow = QueryListRow & {
6
+ startTime?: QueryTimestamp;
7
+ endTime?: QueryTimestamp;
23
8
  engine?: string;
24
9
  mode?: string;
25
10
  isPrivate?: boolean;
26
11
  status: QueryStatus;
27
12
  };
28
-
29
- export type QueryHistoryItem<T extends BaseHistoryRow = BaseHistoryRow> = QueryHistoryHeader | T;
30
-
31
- export type QueryHistoryRowVariant = 'default' | 'search';
32
-
33
- export type QueryHistoryRowAction<T extends BaseHistoryRow = BaseHistoryRow> = {
34
- text: ReactNode;
35
- icon?: ReactNode;
36
- hidden?: boolean;
37
- disabled?: boolean;
38
- onClick: (item: T) => void;
39
- };
40
-
41
- export type QueryHistorySearchConfig = {
42
- value?: string;
43
- fullSearch?: boolean;
44
- hasClear?: boolean;
45
- onUpdate: (data: {value: string; fullSearch: boolean}) => void;
46
- };
47
-
48
- export type QueryHistoryFilterConfig = {
49
- fields?: RegisteredFormFields[];
50
- values?: Record<string, any>;
51
- initialValues?: Record<string, any>;
52
- isChanged?: boolean;
53
- onApply?: (values: Record<string, any>) => void;
54
- onReset?: () => void;
55
- };
56
-
57
- export type QueryHistoryEditingConfig<T extends BaseHistoryRow = BaseHistoryRow> = {
58
- rowId?: T['id'];
59
- onSubmit?: (item: T, title: string) => void;
60
- onCancel?: (item: T) => void;
61
- };
62
-
63
- export type QueryHistoryComparisonConfig<T extends BaseHistoryRow = BaseHistoryRow> = {
64
- enabled: boolean;
65
- comparedRowIds: T['id'][];
66
- onChange: (item: T, selected: boolean) => void;
67
- onCancel: () => void;
68
- onCompare: () => void;
69
- };
70
-
71
- type RowFieldKey<T extends BaseHistoryRow> = Exclude<keyof T & string, keyof HistoryRowRenderProps>;
72
-
73
- export type QueryHistoryFieldKey<T extends BaseHistoryRow = BaseHistoryRow> =
74
- RowFieldKey<T> | 'duration';
75
-
76
- export type QueryHistoryFieldOption<K extends string = string> = {
77
- id: K;
78
- title: ReactNode;
79
- };
80
-
81
- export type QueryHistoryVisibleFieldsConfig<T extends BaseHistoryRow = BaseHistoryRow> = {
82
- value: QueryHistoryFieldKey<T>[];
83
- fields: QueryHistoryFieldOption<QueryHistoryFieldKey<T>>[];
84
- onChange: (value: QueryHistoryFieldKey<T>[]) => void;
85
- };
86
-
87
- export type QueryHistoryEditingRenderData<T extends BaseHistoryRow = BaseHistoryRow> = {
88
- enabled: boolean;
89
- } & Pick<QueryHistoryEditingConfig<T>, 'onSubmit' | 'onCancel'>;
90
-
91
- export type QueryHistoryRowRenderData<T extends BaseHistoryRow = BaseHistoryRow> = {
92
- item: QueryHistoryItem<T>;
93
- index: number;
94
- isActive: boolean;
95
- variant: QueryHistoryRowVariant;
96
- comparison?: {
97
- enabled: boolean;
98
- checked: boolean;
99
- };
100
- visibleFields?: QueryHistoryVisibleFieldsConfig<T>;
101
- actions?: QueryHistoryRowAction<T>[];
102
- editing?: QueryHistoryEditingRenderData<T>;
103
- };
@@ -0,0 +1,92 @@
1
+ import {ReactNode} from 'react';
2
+ import {RegisteredFormFields} from './forms';
3
+
4
+ /** ISO 8601 date string or Unix timestamp in milliseconds. */
5
+ export type QueryTimestamp = string | number;
6
+
7
+ export type QueryListRowRenderProps = {height: number};
8
+
9
+ export type QueryListHeader = {header: string} & QueryListRowRenderProps;
10
+
11
+ export type QueryListRow = {
12
+ id: number;
13
+ title: string;
14
+ query?: string;
15
+ href?: string;
16
+ } & QueryListRowRenderProps;
17
+
18
+ export type QueryListItem<T extends QueryListRow = QueryListRow> = QueryListHeader | T;
19
+
20
+ export type QueryListRowVariant = 'default' | 'search';
21
+
22
+ export type QueryListRowAction<T extends QueryListRow = QueryListRow> = {
23
+ text: ReactNode;
24
+ icon?: ReactNode;
25
+ theme?: 'normal' | 'danger';
26
+ hidden?: boolean;
27
+ disabled?: boolean;
28
+ onClick: (item: T) => void;
29
+ };
30
+
31
+ export type QueryListSearchConfig = {
32
+ value?: string;
33
+ fullSearch?: boolean;
34
+ hasClear?: boolean;
35
+ onUpdate: (data: {value: string; fullSearch: boolean}) => void;
36
+ };
37
+
38
+ export type QueryListFilterConfig = {
39
+ fields?: RegisteredFormFields[];
40
+ values?: Record<string, any>;
41
+ initialValues?: Record<string, any>;
42
+ isChanged?: boolean;
43
+ onApply?: (values: Record<string, any>) => void;
44
+ onReset?: () => void;
45
+ };
46
+
47
+ export type QueryListEditingConfig<T extends QueryListRow = QueryListRow> = {
48
+ rowId?: T['id'];
49
+ onSubmit?: (item: T, title: string) => void;
50
+ onCancel?: (item: T) => void;
51
+ };
52
+
53
+ export type QueryListComparisonConfig<T extends QueryListRow = QueryListRow> = {
54
+ enabled: boolean;
55
+ comparedRowIds: T['id'][];
56
+ onChange: (item: T, selected: boolean) => void;
57
+ onCancel: () => void;
58
+ onCompare: () => void;
59
+ };
60
+
61
+ type RowFieldKey<T extends QueryListRow> = Exclude<keyof T & string, keyof QueryListRowRenderProps>;
62
+
63
+ export type QueryListFieldKey<T extends QueryListRow = QueryListRow> = RowFieldKey<T> | 'duration';
64
+
65
+ export type QueryListFieldOption<K extends string = string> = {
66
+ id: K;
67
+ title: ReactNode;
68
+ };
69
+
70
+ export type QueryListVisibleFieldsConfig<T extends QueryListRow = QueryListRow> = {
71
+ value: QueryListFieldKey<T>[];
72
+ fields: QueryListFieldOption<QueryListFieldKey<T>>[];
73
+ onChange: (value: QueryListFieldKey<T>[]) => void;
74
+ };
75
+
76
+ export type QueryListEditingRenderData<T extends QueryListRow = QueryListRow> = {
77
+ enabled: boolean;
78
+ } & Pick<QueryListEditingConfig<T>, 'onSubmit' | 'onCancel'>;
79
+
80
+ export type QueryListRowRenderData<T extends QueryListRow = QueryListRow> = {
81
+ item: QueryListItem<T>;
82
+ index: number;
83
+ isActive: boolean;
84
+ variant: QueryListRowVariant;
85
+ comparison?: {
86
+ enabled: boolean;
87
+ checked: boolean;
88
+ };
89
+ visibleFields?: QueryListVisibleFieldsConfig<T>;
90
+ actions?: QueryListRowAction<T>[];
91
+ editing?: QueryListEditingRenderData<T>;
92
+ };
@@ -0,0 +1,7 @@
1
+ import {QueryListRow, QueryTimestamp} from './queryList';
2
+
3
+ export type SavedQuery = QueryListRow & {
4
+ savedAt?: QueryTimestamp;
5
+ engine?: string;
6
+ author?: string;
7
+ };
@@ -1,3 +1,3 @@
1
- import {BaseHistoryRow} from './history';
1
+ import {QueryListRow} from './queryList';
2
2
 
3
- export type TutorialHistoryRow = BaseHistoryRow;
3
+ export type TutorialHistoryRow = QueryListRow;
@@ -1,10 +1,3 @@
1
1
  .qp-query-history {
2
2
  height: 100%;
3
-
4
- &__comparison-actions {
5
- position: absolute;
6
- left: 0;
7
- bottom: 0;
8
- width: 100%;
9
- }
10
- }
3
+ }