@gravity-ui/querieskit 1.3.0 → 1.3.1

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 (511) hide show
  1. package/build/cjs/components/AttachmentListPlaceholder/AttachmentListPlaceholder.js +4 -4
  2. package/build/cjs/components/AttachmentListPlaceholder/AttachmentListPlaceholder.js.map +1 -1
  3. package/build/cjs/modules/HistoryLayout/HistoryLayout.d.ts +1 -1
  4. package/build/cjs/modules/HistoryLayout/HistoryLayout.js +1 -1
  5. package/build/cjs/modules/HistoryLayout/HistoryLayout.js.map +1 -1
  6. package/build/cjs/modules/RowsList/RowsList.css +4 -0
  7. package/build/cjs/modules/RowsList/RowsList.css.map +1 -1
  8. package/build/cjs/types/queryList.d.ts +1 -1
  9. package/build/cjs/types/queryList.js.map +1 -1
  10. package/build/cjs/widgets/QueriesHistory/QueriesHistory.js +1 -2
  11. package/build/cjs/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
  12. package/build/cjs/widgets/QueriesHistory/QueriesHistory.stories.d.ts +1 -0
  13. package/build/cjs/widgets/QueriesHistory/QueriesHistory.stories.js +82 -1
  14. package/build/cjs/widgets/QueriesHistory/QueriesHistory.stories.js.map +1 -1
  15. package/build/cjs/widgets/SavedQueries/SavedQueries.stories.js.map +1 -1
  16. package/build/esm/components/AttachmentListPlaceholder/AttachmentListPlaceholder.js +4 -4
  17. package/build/esm/components/AttachmentListPlaceholder/AttachmentListPlaceholder.js.map +1 -1
  18. package/build/esm/modules/HistoryLayout/HistoryLayout.d.ts +1 -1
  19. package/build/esm/modules/HistoryLayout/HistoryLayout.js +1 -1
  20. package/build/esm/modules/HistoryLayout/HistoryLayout.js.map +1 -1
  21. package/build/esm/modules/RowsList/RowsList.css +4 -0
  22. package/build/esm/modules/RowsList/RowsList.css.map +1 -1
  23. package/build/esm/modules/RowsList/RowsList.scss +3 -0
  24. package/build/esm/types/queryList.d.ts +1 -1
  25. package/build/esm/types/queryList.js.map +1 -1
  26. package/build/esm/widgets/QueriesHistory/QueriesHistory.js +1 -2
  27. package/build/esm/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
  28. package/build/esm/widgets/QueriesHistory/QueriesHistory.stories.d.ts +1 -0
  29. package/build/esm/widgets/QueriesHistory/QueriesHistory.stories.js +81 -0
  30. package/build/esm/widgets/QueriesHistory/QueriesHistory.stories.js.map +1 -1
  31. package/build/esm/widgets/SavedQueries/SavedQueries.stories.js.map +1 -1
  32. package/package.json +29 -2
  33. package/.agents/skills/code-review-checklist/SKILL.md +0 -94
  34. package/.agents/skills/github-pr-review/SKILL.md +0 -24
  35. package/.agents/skills/gravity-ui/SKILL.md +0 -175
  36. package/.agents/skills/gravity-ui/references/icons.md +0 -60
  37. package/.agents/skills/gravity-ui/references/layout.md +0 -366
  38. package/.agents/skills/gravity-ui/references/package-routing.md +0 -424
  39. package/.agents/skills/gravity-ui/references/theming.md +0 -309
  40. package/.agents/skills/gravity-ui/rules/hallucination-traps.md +0 -361
  41. package/.agents/skills/gravity-ui/scripts/icon-image-search.sh +0 -63
  42. package/.eslintignore +0 -3
  43. package/.github/workflows/ci.yml +0 -25
  44. package/.github/workflows/main-preview.yml +0 -31
  45. package/.github/workflows/pr-preview-build.yml +0 -13
  46. package/.github/workflows/pr-preview-deploy.yml +0 -22
  47. package/.github/workflows/pr-title.yml +0 -27
  48. package/.github/workflows/release.yml +0 -20
  49. package/.nvmrc +0 -1
  50. package/.prettierrc.js +0 -1
  51. package/.storybook/main.ts +0 -31
  52. package/.storybook/preview.tsx +0 -43
  53. package/.storybook/redefinition.css +0 -3
  54. package/.storybook/tsconfig.json +0 -9
  55. package/.stylelintrc +0 -9
  56. package/AGENTS.md +0 -129
  57. package/CHANGELOG.md +0 -103
  58. package/CODEOWNERS +0 -2
  59. package/CONTRIBUTING.md +0 -31
  60. package/NOTICES.md +0 -8
  61. package/app-builder.config.ts +0 -9
  62. package/commitlint.config.cjs +0 -6
  63. package/eslint.config.mjs +0 -53
  64. package/plans/i18n-rules.md +0 -116
  65. package/plans/navigation-architecture.md +0 -262
  66. package/plans/queries-history-structure.md +0 -143
  67. package/plans/queries-navigation-architecture-review.md +0 -217
  68. package/plans/styles-rules.md +0 -137
  69. package/skills-lock.json +0 -11
  70. package/src/components/AddChartButton/AddChartButton.scss +0 -12
  71. package/src/components/AddChartButton/AddChartButton.stories.tsx +0 -34
  72. package/src/components/AddChartButton/AddChartButton.tsx +0 -139
  73. package/src/components/AddChartButton/index.ts +0 -6
  74. package/src/components/AttachmentList/AttachmentList.scss +0 -25
  75. package/src/components/AttachmentList/AttachmentList.stories.tsx +0 -243
  76. package/src/components/AttachmentList/AttachmentList.tsx +0 -67
  77. package/src/components/AttachmentList/helpers/getIconByAttachmentName.ts +0 -36
  78. package/src/components/AttachmentList/helpers/objectLinkValidator.ts +0 -40
  79. package/src/components/AttachmentList/helpers/stringRequiredValidator.ts +0 -24
  80. package/src/components/AttachmentList/hooks/useKeyDownFormControl.ts +0 -22
  81. package/src/components/AttachmentList/hooks/useLabelRef.ts +0 -25
  82. package/src/components/AttachmentList/i18n/dicts.ts +0 -4
  83. package/src/components/AttachmentList/i18n/en.json +0 -10
  84. package/src/components/AttachmentList/i18n/index.ts +0 -5
  85. package/src/components/AttachmentList/i18n/ru.json +0 -10
  86. package/src/components/AttachmentList/index.ts +0 -4
  87. package/src/components/AttachmentList/internal/AttachmentItem/AttachmentItem.scss +0 -23
  88. package/src/components/AttachmentList/internal/AttachmentItem/AttachmentItem.tsx +0 -75
  89. package/src/components/AttachmentList/internal/AttachmentItem/index.ts +0 -2
  90. package/src/components/AttachmentList/internal/EditAttachmentItem/EditAttachmentItem.tsx +0 -21
  91. package/src/components/AttachmentList/internal/EditAttachmentItem/EditLinkItem.scss +0 -21
  92. package/src/components/AttachmentList/internal/EditAttachmentItem/EditLinkItem.tsx +0 -194
  93. package/src/components/AttachmentList/internal/EditAttachmentItem/FileEdit.tsx +0 -92
  94. package/src/components/AttachmentList/internal/EditAttachmentItem/index.ts +0 -4
  95. package/src/components/AttachmentListPlaceholder/AttachmentListPlaceholder.scss +0 -5
  96. package/src/components/AttachmentListPlaceholder/AttachmentListPlaceholder.stories.tsx +0 -30
  97. package/src/components/AttachmentListPlaceholder/AttachmentListPlaceholder.tsx +0 -72
  98. package/src/components/AttachmentListPlaceholder/assets/empty-attachments.svg +0 -14
  99. package/src/components/AttachmentListPlaceholder/i18n/dicts.ts +0 -4
  100. package/src/components/AttachmentListPlaceholder/i18n/en.json +0 -7
  101. package/src/components/AttachmentListPlaceholder/i18n/index.ts +0 -5
  102. package/src/components/AttachmentListPlaceholder/i18n/ru.json +0 -7
  103. package/src/components/AttachmentListPlaceholder/index.ts +0 -2
  104. package/src/components/Breadcrumbs/Breadcrumbs.scss +0 -25
  105. package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -114
  106. package/src/components/Breadcrumbs/helpers/parsePathSegments.ts +0 -16
  107. package/src/components/Breadcrumbs/i18n/dicts.ts +0 -4
  108. package/src/components/Breadcrumbs/i18n/en.json +0 -4
  109. package/src/components/Breadcrumbs/i18n/index.ts +0 -5
  110. package/src/components/Breadcrumbs/i18n/ru.json +0 -4
  111. package/src/components/Breadcrumbs/index.ts +0 -2
  112. package/src/components/Chart/Chart.scss +0 -40
  113. package/src/components/Chart/Chart.stories.tsx +0 -75
  114. package/src/components/Chart/Chart.tsx +0 -120
  115. package/src/components/Chart/i18n/dicts.ts +0 -4
  116. package/src/components/Chart/i18n/en.json +0 -6
  117. package/src/components/Chart/i18n/index.ts +0 -5
  118. package/src/components/Chart/i18n/ru.json +0 -6
  119. package/src/components/Chart/index.ts +0 -2
  120. package/src/components/ChartEditorForm/ChartEditorForm.scss +0 -20
  121. package/src/components/ChartEditorForm/ChartEditorForm.stories.tsx +0 -88
  122. package/src/components/ChartEditorForm/ChartEditorForm.tsx +0 -120
  123. package/src/components/ChartEditorForm/helpers/resolveLabels.ts +0 -17
  124. package/src/components/ChartEditorForm/i18n/dicts.ts +0 -4
  125. package/src/components/ChartEditorForm/i18n/en.json +0 -12
  126. package/src/components/ChartEditorForm/i18n/index.ts +0 -5
  127. package/src/components/ChartEditorForm/i18n/ru.json +0 -12
  128. package/src/components/ChartEditorForm/index.ts +0 -7
  129. package/src/components/ChartEditorForm/internal/Field.tsx +0 -11
  130. package/src/components/ChartEditorForm/types.ts +0 -44
  131. package/src/components/ClusterRow/ClusterRow.tsx +0 -34
  132. package/src/components/ClusterRow/index.ts +0 -2
  133. package/src/components/Dashboard/Dashboard.scss +0 -4
  134. package/src/components/Dashboard/Dashboard.stories.scss +0 -18
  135. package/src/components/Dashboard/Dashboard.stories.tsx +0 -248
  136. package/src/components/Dashboard/Dashboard.tsx +0 -51
  137. package/src/components/Dashboard/helpers/createDefaultLayout.ts +0 -43
  138. package/src/components/Dashboard/hooks/useDashboardConfig.ts +0 -63
  139. package/src/components/Dashboard/index.ts +0 -2
  140. package/src/components/Dashboard/internal/DashPlate.scss +0 -23
  141. package/src/components/Dashboard/internal/DashPlate.tsx +0 -35
  142. package/src/components/Dashboard/internal/DashboardProvider.tsx +0 -37
  143. package/src/components/Dashboard/types.ts +0 -21
  144. package/src/components/DataTable/DataTable.scss +0 -27
  145. package/src/components/DataTable/DataTable.stories.tsx +0 -65
  146. package/src/components/DataTable/DataTable.tsx +0 -100
  147. package/src/components/DataTable/index.ts +0 -1
  148. package/src/components/EditableRowTitle/EditableRowTitle.tsx +0 -67
  149. package/src/components/EditableRowTitle/index.ts +0 -2
  150. package/src/components/EmptyContent/EmptyContent.scss +0 -3
  151. package/src/components/EmptyContent/EmptyContent.tsx +0 -57
  152. package/src/components/EmptyContent/i18n/dicts.ts +0 -4
  153. package/src/components/EmptyContent/i18n/en.json +0 -7
  154. package/src/components/EmptyContent/i18n/index.ts +0 -5
  155. package/src/components/EmptyContent/i18n/ru.json +0 -7
  156. package/src/components/EmptyContent/index.ts +0 -1
  157. package/src/components/ErrorTree/ErrorTree.stories.tsx +0 -94
  158. package/src/components/ErrorTree/ErrorTree.tsx +0 -30
  159. package/src/components/ErrorTree/helpers/formatAttributes.ts +0 -9
  160. package/src/components/ErrorTree/helpers/getIntermediateChain.ts +0 -21
  161. package/src/components/ErrorTree/i18n/dicts.ts +0 -4
  162. package/src/components/ErrorTree/i18n/en.json +0 -11
  163. package/src/components/ErrorTree/i18n/index.ts +0 -5
  164. package/src/components/ErrorTree/i18n/ru.json +0 -13
  165. package/src/components/ErrorTree/index.ts +0 -1
  166. package/src/components/ErrorTree/internal/ErrorTreeChildren.scss +0 -5
  167. package/src/components/ErrorTree/internal/ErrorTreeChildren.tsx +0 -25
  168. package/src/components/ErrorTree/internal/ErrorTreeNode.scss +0 -95
  169. package/src/components/ErrorTree/internal/ErrorTreeNode.tsx +0 -178
  170. package/src/components/ErrorTree/internal/IntermediateMessages.scss +0 -13
  171. package/src/components/ErrorTree/internal/IntermediateMessages.tsx +0 -127
  172. package/src/components/FieldsSearchToolbar/FieldsSearchToolbar.tsx +0 -48
  173. package/src/components/FieldsSearchToolbar/index.ts +0 -2
  174. package/src/components/FieldsSelector/FieldsSelector.scss +0 -18
  175. package/src/components/FieldsSelector/FieldsSelector.stories.tsx +0 -48
  176. package/src/components/FieldsSelector/FieldsSelector.tsx +0 -92
  177. package/src/components/FieldsSelector/i18n/dicts.ts +0 -4
  178. package/src/components/FieldsSelector/i18n/en.json +0 -3
  179. package/src/components/FieldsSelector/i18n/index.ts +0 -5
  180. package/src/components/FieldsSelector/i18n/ru.json +0 -3
  181. package/src/components/FieldsSelector/index.ts +0 -2
  182. package/src/components/HistoryFilter/HistoryFilter.scss +0 -5
  183. package/src/components/HistoryFilter/HistoryFilter.stories.tsx +0 -69
  184. package/src/components/HistoryFilter/HistoryFilter.tsx +0 -64
  185. package/src/components/HistoryFilter/i18n/dicts.ts +0 -4
  186. package/src/components/HistoryFilter/i18n/en.json +0 -4
  187. package/src/components/HistoryFilter/i18n/index.ts +0 -5
  188. package/src/components/HistoryFilter/i18n/ru.json +0 -4
  189. package/src/components/HistoryFilter/index.ts +0 -1
  190. package/src/components/HistoryGroupHeader/HistoryGroupHeader.scss +0 -7
  191. package/src/components/HistoryGroupHeader/HistoryGroupHeader.tsx +0 -18
  192. package/src/components/HistoryGroupHeader/index.ts +0 -1
  193. package/src/components/HistoryPrivateIcon/HistoryPrivateIcon.scss +0 -7
  194. package/src/components/HistoryPrivateIcon/HistoryPrivateIcon.tsx +0 -22
  195. package/src/components/HistoryPrivateIcon/index.ts +0 -1
  196. package/src/components/Icons/LogoCPlusPlus.tsx +0 -34
  197. package/src/components/Icons/index.ts +0 -1
  198. package/src/components/LazyList/LazyList.scss +0 -13
  199. package/src/components/LazyList/LazyList.tsx +0 -97
  200. package/src/components/LazyList/index.ts +0 -2
  201. package/src/components/ListSpinner/ListSpinner.scss +0 -3
  202. package/src/components/ListSpinner/ListSpinner.tsx +0 -18
  203. package/src/components/ListSpinner/index.ts +0 -2
  204. package/src/components/MonacoEditor/MonacoEditor.tsx +0 -112
  205. package/src/components/MonacoEditor/MonacoEditorThemes.tsx +0 -73
  206. package/src/components/MonacoEditor/index.ts +0 -11
  207. package/src/components/MonacoEditor/monaco-yql-languages/_.contribution.ts +0 -193
  208. package/src/components/MonacoEditor/monaco-yql-languages/clickhouse/clickhouse.contribution.ts +0 -14
  209. package/src/components/MonacoEditor/monaco-yql-languages/clickhouse/clickhouse.keywords.ts +0 -146
  210. package/src/components/MonacoEditor/monaco-yql-languages/clickhouse/clickhouse.ts +0 -217
  211. package/src/components/MonacoEditor/monaco-yql-languages/constants.ts +0 -6
  212. package/src/components/MonacoEditor/monaco-yql-languages/fillers/monaco-editor-core.ts +0 -3
  213. package/src/components/MonacoEditor/monaco-yql-languages/index.ts +0 -1
  214. package/src/components/MonacoEditor/monaco-yql-languages/monaco.contribution.ts +0 -5
  215. package/src/components/MonacoEditor/monaco-yql-languages/s-expressions/s-expressions.contribution.ts +0 -14
  216. package/src/components/MonacoEditor/monaco-yql-languages/s-expressions/s-expressions.keywords.ts +0 -97
  217. package/src/components/MonacoEditor/monaco-yql-languages/s-expressions/s-expressions.ts +0 -170
  218. package/src/components/MonacoEditor/monaco-yql-languages/themes/themes.contribution.ts +0 -35
  219. package/src/components/MonacoEditor/monaco-yql-languages/yql/yql.contribution.ts +0 -14
  220. package/src/components/MonacoEditor/monaco-yql-languages/yql/yql.keywords.ts +0 -13
  221. package/src/components/MonacoEditor/monaco-yql-languages/yql/yql.ts +0 -178
  222. package/src/components/MonacoEditor/monaco-yql-languages/yql_ansi/yql_ansi.contribution.ts +0 -14
  223. package/src/components/MonacoEditor/monaco-yql-languages/yql_ansi/yql_ansi.keywords.ts +0 -45
  224. package/src/components/MonacoEditor/monaco-yql-languages/yql_ansi/yql_ansi.ts +0 -142
  225. package/src/components/NavigationActionButtons/NavigationActionButtons.tsx +0 -46
  226. package/src/components/NavigationActionButtons/index.ts +0 -2
  227. package/src/components/NavigationItemRow/NavigationItemRow.tsx +0 -28
  228. package/src/components/NavigationItemRow/index.ts +0 -2
  229. package/src/components/PathEditor/PathEditor.scss +0 -41
  230. package/src/components/PathEditor/PathEditor.stories.helpers.ts +0 -118
  231. package/src/components/PathEditor/PathEditor.stories.tsx +0 -57
  232. package/src/components/PathEditor/PathEditor.tsx +0 -380
  233. package/src/components/PathEditor/helpers/suggestions.ts +0 -40
  234. package/src/components/PathEditor/i18n/dicts.ts +0 -4
  235. package/src/components/PathEditor/i18n/en.json +0 -4
  236. package/src/components/PathEditor/i18n/index.ts +0 -5
  237. package/src/components/PathEditor/i18n/ru.json +0 -4
  238. package/src/components/PathEditor/index.ts +0 -2
  239. package/src/components/QueryDuration/QueryDuration.scss +0 -6
  240. package/src/components/QueryDuration/QueryDuration.stories.tsx +0 -40
  241. package/src/components/QueryDuration/QueryDuration.tsx +0 -21
  242. package/src/components/QueryDuration/index.ts +0 -1
  243. package/src/components/QueryDuration/useQueryDuration.ts +0 -34
  244. package/src/components/QueryResultsTable/QueryResultsTable.scss +0 -65
  245. package/src/components/QueryResultsTable/QueryResultsTable.tsx +0 -112
  246. package/src/components/QueryResultsTable/helpers/formatQueryResultType.ts +0 -76
  247. package/src/components/QueryResultsTable/helpers/formatQueryResultValue.ts +0 -38
  248. package/src/components/QueryResultsTable/i18n/dicts.ts +0 -4
  249. package/src/components/QueryResultsTable/i18n/en.json +0 -5
  250. package/src/components/QueryResultsTable/i18n/index.ts +0 -4
  251. package/src/components/QueryResultsTable/i18n/ru.json +0 -5
  252. package/src/components/QueryResultsTable/index.ts +0 -3
  253. package/src/components/QueryResultsTable/internal/QueryResultCell.tsx +0 -63
  254. package/src/components/QueryStatusIcon/QueryStatusIcon.scss +0 -17
  255. package/src/components/QueryStatusIcon/QueryStatusIcon.stories.tsx +0 -50
  256. package/src/components/QueryStatusIcon/QueryStatusIcon.tsx +0 -37
  257. package/src/components/QueryStatusIcon/index.ts +0 -1
  258. package/src/components/RowActionsMenu/RowActionsMenu.tsx +0 -47
  259. package/src/components/RowActionsMenu/index.ts +0 -2
  260. package/src/components/RowLink/RowLink.scss +0 -8
  261. package/src/components/RowLink/RowLink.tsx +0 -23
  262. package/src/components/RowLink/index.ts +0 -2
  263. package/src/components/SearchRowLayout/SearchRowLayout.scss +0 -18
  264. package/src/components/SearchRowLayout/SearchRowLayout.tsx +0 -45
  265. package/src/components/SearchRowLayout/helpers/fitQueryToVisibleLines.ts +0 -10
  266. package/src/components/SearchRowLayout/helpers/monacoConfig.ts +0 -25
  267. package/src/components/SearchRowLayout/index.ts +0 -2
  268. package/src/components/SearchWithButtons/SearchWithButtons.scss +0 -10
  269. package/src/components/SearchWithButtons/SearchWithButtons.stories.tsx +0 -107
  270. package/src/components/SearchWithButtons/SearchWithButtons.tsx +0 -56
  271. package/src/components/SearchWithButtons/index.ts +0 -2
  272. package/src/components/SimpleForm/CheckboxGroupField.tsx +0 -53
  273. package/src/components/SimpleForm/RangeDatePickerField.tsx +0 -50
  274. package/src/components/SimpleForm/SelectField.tsx +0 -24
  275. package/src/components/SimpleForm/SimpleForm.stories.tsx +0 -115
  276. package/src/components/SimpleForm/SimpleForm.tsx +0 -65
  277. package/src/components/SimpleForm/SwitchField.tsx +0 -23
  278. package/src/components/SimpleForm/helpers/controlsRegistry.ts +0 -24
  279. package/src/components/SimpleForm/helpers/getInitialValues.ts +0 -10
  280. package/src/components/SimpleForm/helpers/index.ts +0 -2
  281. package/src/components/SimpleForm/index.ts +0 -7
  282. package/src/components/SkeletonRows/SkeletonRows.tsx +0 -24
  283. package/src/components/SkeletonRows/index.ts +0 -2
  284. package/src/components/index.ts +0 -71
  285. package/src/constants/query.ts +0 -10
  286. package/src/constants/row.ts +0 -2
  287. package/src/helpers/buildColumnsFromKeys.ts +0 -17
  288. package/src/helpers/createUuid.ts +0 -3
  289. package/src/helpers/getDefaultNavigationIcon.ts +0 -33
  290. package/src/helpers/getListKey.ts +0 -12
  291. package/src/helpers/getParentPath.ts +0 -10
  292. package/src/helpers/isEmptyValue.ts +0 -2
  293. package/src/helpers/isFieldVisible.ts +0 -20
  294. package/src/helpers/isObjectEqual.ts +0 -15
  295. package/src/helpers/time.ts +0 -29
  296. package/src/helpers/useDebouncedValue.ts +0 -14
  297. package/src/helpers/useLoadMoreSentinel.ts +0 -31
  298. package/src/helpers/useToggle.ts +0 -11
  299. package/src/helpers/useVisibleColumns.ts +0 -26
  300. package/src/i18n/index.ts +0 -26
  301. package/src/index.ts +0 -12
  302. package/src/modules/Attachments/Attachments.scss +0 -10
  303. package/src/modules/Attachments/Attachments.stories.tsx +0 -112
  304. package/src/modules/Attachments/Attachments.tsx +0 -336
  305. package/src/modules/Attachments/i18n/dicts.ts +0 -4
  306. package/src/modules/Attachments/i18n/en.json +0 -5
  307. package/src/modules/Attachments/i18n/index.ts +0 -5
  308. package/src/modules/Attachments/i18n/ru.json +0 -5
  309. package/src/modules/Attachments/index.ts +0 -2
  310. package/src/modules/ChartEditor/ChartEditor.scss +0 -12
  311. package/src/modules/ChartEditor/ChartEditor.tsx +0 -116
  312. package/src/modules/ChartEditor/i18n/dicts.ts +0 -4
  313. package/src/modules/ChartEditor/i18n/en.json +0 -3
  314. package/src/modules/ChartEditor/i18n/index.ts +0 -5
  315. package/src/modules/ChartEditor/i18n/ru.json +0 -3
  316. package/src/modules/ChartEditor/index.ts +0 -2
  317. package/src/modules/ChartEditor/story/ChartEditor.stories.tsx +0 -186
  318. package/src/modules/ChartEditor/story/mockData.ts +0 -222
  319. package/src/modules/ChartEditor/types.ts +0 -18
  320. package/src/modules/ClustersList/ClustersList.scss +0 -11
  321. package/src/modules/ClustersList/ClustersList.tsx +0 -49
  322. package/src/modules/ClustersList/index.ts +0 -2
  323. package/src/modules/HistoryComparisonActions/HistoryComparisonActions.scss +0 -4
  324. package/src/modules/HistoryComparisonActions/HistoryComparisonActions.tsx +0 -42
  325. package/src/modules/HistoryComparisonActions/index.ts +0 -2
  326. package/src/modules/HistoryHeader/HistoryHeader.stories.tsx +0 -47
  327. package/src/modules/HistoryHeader/HistoryHeader.tsx +0 -58
  328. package/src/modules/HistoryHeader/index.ts +0 -1
  329. package/src/modules/HistoryHeader/internal/FullSearchToggleButton.tsx +0 -16
  330. package/src/modules/HistoryLayout/HistoryLayout.scss +0 -7
  331. package/src/modules/HistoryLayout/HistoryLayout.tsx +0 -43
  332. package/src/modules/HistoryLayout/index.ts +0 -2
  333. package/src/modules/HistoryRow/HistoryRow.scss +0 -32
  334. package/src/modules/HistoryRow/HistoryRow.stories.tsx +0 -91
  335. package/src/modules/HistoryRow/HistoryRow.tsx +0 -77
  336. package/src/modules/HistoryRow/index.ts +0 -1
  337. package/src/modules/HistorySearchRow/HistorySearchRow.scss +0 -13
  338. package/src/modules/HistorySearchRow/HistorySearchRow.stories.tsx +0 -52
  339. package/src/modules/HistorySearchRow/HistorySearchRow.tsx +0 -62
  340. package/src/modules/HistorySearchRow/helpers/resolveMonacoLanguage.ts +0 -19
  341. package/src/modules/HistorySearchRow/index.ts +0 -1
  342. package/src/modules/NavigationDetail/NavigationDetail.scss +0 -13
  343. package/src/modules/NavigationDetail/NavigationDetail.tsx +0 -121
  344. package/src/modules/NavigationDetail/helpers/getInitialTab.ts +0 -9
  345. package/src/modules/NavigationDetail/helpers/getVisibleTabs.ts +0 -5
  346. package/src/modules/NavigationDetail/index.ts +0 -2
  347. package/src/modules/NavigationDetail/internal/NavigationDetailTabs.tsx +0 -32
  348. package/src/modules/NavigationHeader/NavigationHeader.stories.tsx +0 -118
  349. package/src/modules/NavigationHeader/NavigationHeader.tsx +0 -33
  350. package/src/modules/NavigationHeader/index.ts +0 -2
  351. package/src/modules/NavigationItemsList/NavigationItemsList.scss +0 -65
  352. package/src/modules/NavigationItemsList/NavigationItemsList.tsx +0 -92
  353. package/src/modules/NavigationItemsList/index.ts +0 -2
  354. package/src/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.tsx +0 -45
  355. package/src/modules/NavigationItemsList/internal/NavigationItemsListHeader.scss +0 -6
  356. package/src/modules/NavigationItemsList/internal/NavigationItemsListHeader.tsx +0 -54
  357. package/src/modules/NavigationItemsList/internal/useParentRow.ts +0 -23
  358. package/src/modules/NavigationMeta/NavigationMeta.scss +0 -25
  359. package/src/modules/NavigationMeta/NavigationMeta.tsx +0 -81
  360. package/src/modules/NavigationMeta/helpers/buildMetaGroups.tsx +0 -27
  361. package/src/modules/NavigationMeta/i18n/dicts.ts +0 -4
  362. package/src/modules/NavigationMeta/i18n/en.json +0 -4
  363. package/src/modules/NavigationMeta/i18n/index.ts +0 -5
  364. package/src/modules/NavigationMeta/i18n/ru.json +0 -4
  365. package/src/modules/NavigationMeta/index.ts +0 -3
  366. package/src/modules/NavigationMeta/story/NavigationMeta.stories.tsx +0 -80
  367. package/src/modules/NavigationMeta/story/mockData.ts +0 -22
  368. package/src/modules/NavigationPreview/NavigationPreview.scss +0 -32
  369. package/src/modules/NavigationPreview/NavigationPreview.tsx +0 -155
  370. package/src/modules/NavigationPreview/helpers/buildPreviewColumns.tsx +0 -11
  371. package/src/modules/NavigationPreview/helpers/filterPreviewRows.ts +0 -29
  372. package/src/modules/NavigationPreview/i18n/dicts.ts +0 -4
  373. package/src/modules/NavigationPreview/i18n/en.json +0 -3
  374. package/src/modules/NavigationPreview/i18n/index.ts +0 -5
  375. package/src/modules/NavigationPreview/i18n/ru.json +0 -3
  376. package/src/modules/NavigationPreview/index.ts +0 -4
  377. package/src/modules/NavigationPreview/story/NavigationPreview.stories.tsx +0 -123
  378. package/src/modules/NavigationPreview/story/mockData.ts +0 -14
  379. package/src/modules/NavigationSchema/NavigationSchema.scss +0 -24
  380. package/src/modules/NavigationSchema/NavigationSchema.tsx +0 -118
  381. package/src/modules/NavigationSchema/helpers/buildSchemaColumns.tsx +0 -54
  382. package/src/modules/NavigationSchema/helpers/filterSchema.ts +0 -18
  383. package/src/modules/NavigationSchema/i18n/dicts.ts +0 -4
  384. package/src/modules/NavigationSchema/i18n/en.json +0 -9
  385. package/src/modules/NavigationSchema/i18n/index.ts +0 -5
  386. package/src/modules/NavigationSchema/i18n/ru.json +0 -9
  387. package/src/modules/NavigationSchema/index.ts +0 -4
  388. package/src/modules/NavigationSchema/story/NavigationSchema.stories.tsx +0 -112
  389. package/src/modules/NavigationSchema/story/mockData.ts +0 -9
  390. package/src/modules/NavigationView/NavigationView.scss +0 -44
  391. package/src/modules/NavigationView/NavigationView.tsx +0 -60
  392. package/src/modules/NavigationView/helpers/buildViewColumns.tsx +0 -11
  393. package/src/modules/NavigationView/i18n/dicts.ts +0 -4
  394. package/src/modules/NavigationView/i18n/en.json +0 -3
  395. package/src/modules/NavigationView/i18n/index.ts +0 -5
  396. package/src/modules/NavigationView/i18n/ru.json +0 -3
  397. package/src/modules/NavigationView/index.ts +0 -3
  398. package/src/modules/NavigationView/internal/NavigationViewSectionItem.tsx +0 -70
  399. package/src/modules/NavigationView/story/NavigationView.stories.tsx +0 -110
  400. package/src/modules/NavigationView/story/mockData.ts +0 -35
  401. package/src/modules/QueriesList/QueriesList.scss +0 -10
  402. package/src/modules/QueriesList/QueriesList.tsx +0 -98
  403. package/src/modules/QueriesList/index.ts +0 -2
  404. package/src/modules/QueryStatistics/QueryStatistics.scss +0 -3
  405. package/src/modules/QueryStatistics/QueryStatistics.tsx +0 -125
  406. package/src/modules/QueryStatistics/helpers.ts +0 -96
  407. package/src/modules/QueryStatistics/i18n/dicts.ts +0 -4
  408. package/src/modules/QueryStatistics/i18n/en.json +0 -16
  409. package/src/modules/QueryStatistics/i18n/index.ts +0 -4
  410. package/src/modules/QueryStatistics/i18n/ru.json +0 -16
  411. package/src/modules/QueryStatistics/index.ts +0 -13
  412. package/src/modules/QueryStatistics/internal/MetricCell.scss +0 -12
  413. package/src/modules/QueryStatistics/internal/MetricCell.tsx +0 -99
  414. package/src/modules/QueryStatistics/internal/QueryStatisticsTable.scss +0 -8
  415. package/src/modules/QueryStatistics/internal/QueryStatisticsTable.tsx +0 -135
  416. package/src/modules/QueryStatistics/internal/QueryStatisticsToolbar.scss +0 -1
  417. package/src/modules/QueryStatistics/internal/QueryStatisticsToolbar.tsx +0 -61
  418. package/src/modules/QueryStatistics/story/QueryStatistics.stories.tsx +0 -71
  419. package/src/modules/RowsList/RowsList.scss +0 -5
  420. package/src/modules/RowsList/RowsList.tsx +0 -96
  421. package/src/modules/RowsList/helpers/prepareRowData.ts +0 -61
  422. package/src/modules/RowsList/index.ts +0 -2
  423. package/src/modules/SavedQueryRow/SavedQueryRow.scss +0 -20
  424. package/src/modules/SavedQueryRow/SavedQueryRow.tsx +0 -60
  425. package/src/modules/SavedQueryRow/index.ts +0 -2
  426. package/src/modules/SavedQuerySearchRow/SavedQuerySearchRow.scss +0 -15
  427. package/src/modules/SavedQuerySearchRow/SavedQuerySearchRow.tsx +0 -58
  428. package/src/modules/SavedQuerySearchRow/index.ts +0 -2
  429. package/src/modules/TutorialRow/TutorialRow.scss +0 -9
  430. package/src/modules/TutorialRow/TutorialRow.stories.tsx +0 -43
  431. package/src/modules/TutorialRow/TutorialRow.tsx +0 -25
  432. package/src/modules/TutorialRow/index.ts +0 -2
  433. package/src/modules/TutorialSearchRow/TutorialSearchRow.scss +0 -5
  434. package/src/modules/TutorialSearchRow/TutorialSearchRow.stories.tsx +0 -44
  435. package/src/modules/TutorialSearchRow/TutorialSearchRow.tsx +0 -33
  436. package/src/modules/TutorialSearchRow/index.ts +0 -2
  437. package/src/modules/index.ts +0 -50
  438. package/src/types/declarations.d.ts +0 -25
  439. package/src/types/errorTree.ts +0 -30
  440. package/src/types/forms.ts +0 -33
  441. package/src/types/history.ts +0 -12
  442. package/src/types/navigation.ts +0 -209
  443. package/src/types/pathEditor.ts +0 -29
  444. package/src/types/queryList.ts +0 -92
  445. package/src/types/queryResults.ts +0 -48
  446. package/src/types/queryStatistics.ts +0 -67
  447. package/src/types/savedQueries.ts +0 -7
  448. package/src/types/tutorial.ts +0 -3
  449. package/src/widgets/DashboardCharts/DashboardCharts.scss +0 -25
  450. package/src/widgets/DashboardCharts/DashboardCharts.tsx +0 -214
  451. package/src/widgets/DashboardCharts/helpers/chartTypeIcons.ts +0 -33
  452. package/src/widgets/DashboardCharts/i18n/dicts.ts +0 -4
  453. package/src/widgets/DashboardCharts/i18n/en.json +0 -7
  454. package/src/widgets/DashboardCharts/i18n/index.ts +0 -5
  455. package/src/widgets/DashboardCharts/i18n/ru.json +0 -7
  456. package/src/widgets/DashboardCharts/index.ts +0 -2
  457. package/src/widgets/DashboardCharts/internal/EmptyDashboardPlaceholder.tsx +0 -26
  458. package/src/widgets/DashboardCharts/story/DashboardCharts.stories.scss +0 -6
  459. package/src/widgets/DashboardCharts/story/DashboardCharts.stories.tsx +0 -77
  460. package/src/widgets/DashboardCharts/story/mockData.ts +0 -419
  461. package/src/widgets/DashboardCharts/types.ts +0 -30
  462. package/src/widgets/QueriesHistory/QueriesHistory.scss +0 -3
  463. package/src/widgets/QueriesHistory/QueriesHistory.stories.tsx +0 -276
  464. package/src/widgets/QueriesHistory/QueriesHistory.tsx +0 -71
  465. package/src/widgets/QueriesHistory/i18n/dicts.ts +0 -4
  466. package/src/widgets/QueriesHistory/i18n/en.json +0 -3
  467. package/src/widgets/QueriesHistory/i18n/index.ts +0 -5
  468. package/src/widgets/QueriesHistory/i18n/ru.json +0 -3
  469. package/src/widgets/QueriesHistory/index.ts +0 -2
  470. package/src/widgets/QueriesHistory/internal/HistoryRowContent.tsx +0 -22
  471. package/src/widgets/QueriesNavigation/QueriesNavigation.scss +0 -9
  472. package/src/widgets/QueriesNavigation/QueriesNavigation.stories.tsx +0 -409
  473. package/src/widgets/QueriesNavigation/QueriesNavigation.tsx +0 -195
  474. package/src/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.tsx +0 -8
  475. package/src/widgets/QueriesNavigation/helpers/createNavigationDetailResolver.ts +0 -28
  476. package/src/widgets/QueriesNavigation/helpers/createTableDetailConfig.tsx +0 -127
  477. package/src/widgets/QueriesNavigation/i18n/dicts.ts +0 -4
  478. package/src/widgets/QueriesNavigation/i18n/en.json +0 -10
  479. package/src/widgets/QueriesNavigation/i18n/index.ts +0 -5
  480. package/src/widgets/QueriesNavigation/i18n/ru.json +0 -10
  481. package/src/widgets/QueriesNavigation/index.ts +0 -13
  482. package/src/widgets/QueryResults/QueryResults.scss +0 -25
  483. package/src/widgets/QueryResults/QueryResults.stories.tsx +0 -155
  484. package/src/widgets/QueryResults/QueryResults.tsx +0 -121
  485. package/src/widgets/QueryResults/i18n/dicts.ts +0 -4
  486. package/src/widgets/QueryResults/i18n/en.json +0 -10
  487. package/src/widgets/QueryResults/i18n/index.ts +0 -4
  488. package/src/widgets/QueryResults/i18n/ru.json +0 -12
  489. package/src/widgets/QueryResults/index.ts +0 -2
  490. package/src/widgets/QueryResults/internal/QueryResultsSchema.tsx +0 -41
  491. package/src/widgets/SavedQueries/SavedQueries.scss +0 -3
  492. package/src/widgets/SavedQueries/SavedQueries.stories.tsx +0 -192
  493. package/src/widgets/SavedQueries/SavedQueries.tsx +0 -77
  494. package/src/widgets/SavedQueries/SavedQueryRowContent.tsx +0 -26
  495. package/src/widgets/SavedQueries/i18n/dicts.ts +0 -4
  496. package/src/widgets/SavedQueries/i18n/en.json +0 -3
  497. package/src/widgets/SavedQueries/i18n/index.ts +0 -4
  498. package/src/widgets/SavedQueries/i18n/ru.json +0 -3
  499. package/src/widgets/SavedQueries/index.ts +0 -2
  500. package/src/widgets/TutorialsHistory/TutorialRowContent.tsx +0 -16
  501. package/src/widgets/TutorialsHistory/TutorialsHistory.scss +0 -3
  502. package/src/widgets/TutorialsHistory/TutorialsHistory.stories.tsx +0 -135
  503. package/src/widgets/TutorialsHistory/TutorialsHistory.tsx +0 -63
  504. package/src/widgets/TutorialsHistory/i18n/dicts.ts +0 -4
  505. package/src/widgets/TutorialsHistory/i18n/en.json +0 -3
  506. package/src/widgets/TutorialsHistory/i18n/index.ts +0 -5
  507. package/src/widgets/TutorialsHistory/i18n/ru.json +0 -3
  508. package/src/widgets/TutorialsHistory/index.ts +0 -2
  509. package/src/widgets/index.ts +0 -20
  510. package/tsconfig.json +0 -20
  511. package/tsconfig.publish.json +0 -11
@@ -1 +1 @@
1
- {"version":3,"sources":["RowsList.scss"],"names":[],"mappings":"AACE;EACE,qDAAA;AAAJ","file":"RowsList.css","sourcesContent":[".qp-rows-list {\n .g-list__item_selected:hover {\n background-color: var(--g-color-base-selection-hover);\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["RowsList.scss"],"names":[],"mappings":"AAAA;EACE,YAAA;EACA,cAAA;AACF;AACE;EACE,qDAAA;AACJ","file":"RowsList.css","sourcesContent":[".qp-rows-list {\n height: 100%;\n overflow: auto;\n\n .g-list__item_selected:hover {\n background-color: var(--g-color-base-selection-hover);\n }\n}\n"],"sourceRoot":""}
@@ -1,4 +1,7 @@
1
1
  .qp-rows-list {
2
+ height: 100%;
3
+ overflow: auto;
4
+
2
5
  .g-list__item_selected:hover {
3
6
  background-color: var(--g-color-base-selection-hover);
4
7
  }
@@ -9,7 +9,7 @@ export type QueryListHeader = {
9
9
  header: string;
10
10
  } & QueryListRowRenderProps;
11
11
  export type QueryListRow = {
12
- id: number;
12
+ id: number | string;
13
13
  title: string;
14
14
  query?: string;
15
15
  href?: string;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["queryList.ts"],"sourcesContent":["import {ReactNode} from 'react';\nimport {RegisteredFormFields} from './forms';\n\n/** ISO 8601 date string or Unix timestamp in milliseconds. */\nexport type QueryTimestamp = string | number;\n\nexport type QueryListRowRenderProps = {height: number};\n\nexport type QueryListHeader = {header: string} & QueryListRowRenderProps;\n\nexport type QueryListRow = {\n id: number;\n title: string;\n query?: string;\n href?: string;\n} & QueryListRowRenderProps;\n\nexport type QueryListItem<T extends QueryListRow = QueryListRow> = QueryListHeader | T;\n\nexport type QueryListRowVariant = 'default' | 'search';\n\nexport type QueryListRowAction<T extends QueryListRow = QueryListRow> = {\n text: ReactNode;\n icon?: ReactNode;\n theme?: 'normal' | 'danger';\n hidden?: boolean;\n disabled?: boolean;\n onClick: (item: T) => void;\n};\n\nexport type QueryListSearchConfig = {\n value?: string;\n fullSearch?: boolean;\n hasClear?: boolean;\n onUpdate: (data: {value: string; fullSearch: boolean}) => void;\n};\n\nexport type QueryListFilterConfig = {\n fields?: RegisteredFormFields[];\n values?: Record<string, any>;\n initialValues?: Record<string, any>;\n isChanged?: boolean;\n onApply?: (values: Record<string, any>) => void;\n onReset?: () => void;\n};\n\nexport type QueryListEditingConfig<T extends QueryListRow = QueryListRow> = {\n rowId?: T['id'];\n onSubmit?: (item: T, title: string) => void;\n onCancel?: (item: T) => void;\n};\n\nexport type QueryListComparisonConfig<T extends QueryListRow = QueryListRow> = {\n enabled: boolean;\n comparedRowIds: T['id'][];\n onChange: (item: T, selected: boolean) => void;\n onCancel: () => void;\n onCompare: () => void;\n};\n\ntype RowFieldKey<T extends QueryListRow> = Exclude<keyof T & string, keyof QueryListRowRenderProps>;\n\nexport type QueryListFieldKey<T extends QueryListRow = QueryListRow> = RowFieldKey<T> | 'duration';\n\nexport type QueryListFieldOption<K extends string = string> = {\n id: K;\n title: ReactNode;\n};\n\nexport type QueryListVisibleFieldsConfig<T extends QueryListRow = QueryListRow> = {\n value: QueryListFieldKey<T>[];\n fields: QueryListFieldOption<QueryListFieldKey<T>>[];\n onChange: (value: QueryListFieldKey<T>[]) => void;\n};\n\nexport type QueryListEditingRenderData<T extends QueryListRow = QueryListRow> = {\n enabled: boolean;\n} & Pick<QueryListEditingConfig<T>, 'onSubmit' | 'onCancel'>;\n\nexport type QueryListRowRenderData<T extends QueryListRow = QueryListRow> = {\n item: QueryListItem<T>;\n index: number;\n isActive: boolean;\n variant: QueryListRowVariant;\n comparison?: {\n enabled: boolean;\n checked: boolean;\n };\n visibleFields?: QueryListVisibleFieldsConfig<T>;\n actions?: QueryListRowAction<T>[];\n editing?: QueryListEditingRenderData<T>;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["queryList.ts"],"sourcesContent":["import {ReactNode} from 'react';\nimport {RegisteredFormFields} from './forms';\n\n/** ISO 8601 date string or Unix timestamp in milliseconds. */\nexport type QueryTimestamp = string | number;\n\nexport type QueryListRowRenderProps = {height: number};\n\nexport type QueryListHeader = {header: string} & QueryListRowRenderProps;\n\nexport type QueryListRow = {\n id: number | string;\n title: string;\n query?: string;\n href?: string;\n} & QueryListRowRenderProps;\n\nexport type QueryListItem<T extends QueryListRow = QueryListRow> = QueryListHeader | T;\n\nexport type QueryListRowVariant = 'default' | 'search';\n\nexport type QueryListRowAction<T extends QueryListRow = QueryListRow> = {\n text: ReactNode;\n icon?: ReactNode;\n theme?: 'normal' | 'danger';\n hidden?: boolean;\n disabled?: boolean;\n onClick: (item: T) => void;\n};\n\nexport type QueryListSearchConfig = {\n value?: string;\n fullSearch?: boolean;\n hasClear?: boolean;\n onUpdate: (data: {value: string; fullSearch: boolean}) => void;\n};\n\nexport type QueryListFilterConfig = {\n fields?: RegisteredFormFields[];\n values?: Record<string, any>;\n initialValues?: Record<string, any>;\n isChanged?: boolean;\n onApply?: (values: Record<string, any>) => void;\n onReset?: () => void;\n};\n\nexport type QueryListEditingConfig<T extends QueryListRow = QueryListRow> = {\n rowId?: T['id'];\n onSubmit?: (item: T, title: string) => void;\n onCancel?: (item: T) => void;\n};\n\nexport type QueryListComparisonConfig<T extends QueryListRow = QueryListRow> = {\n enabled: boolean;\n comparedRowIds: T['id'][];\n onChange: (item: T, selected: boolean) => void;\n onCancel: () => void;\n onCompare: () => void;\n};\n\ntype RowFieldKey<T extends QueryListRow> = Exclude<keyof T & string, keyof QueryListRowRenderProps>;\n\nexport type QueryListFieldKey<T extends QueryListRow = QueryListRow> = RowFieldKey<T> | 'duration';\n\nexport type QueryListFieldOption<K extends string = string> = {\n id: K;\n title: ReactNode;\n};\n\nexport type QueryListVisibleFieldsConfig<T extends QueryListRow = QueryListRow> = {\n value: QueryListFieldKey<T>[];\n fields: QueryListFieldOption<QueryListFieldKey<T>>[];\n onChange: (value: QueryListFieldKey<T>[]) => void;\n};\n\nexport type QueryListEditingRenderData<T extends QueryListRow = QueryListRow> = {\n enabled: boolean;\n} & Pick<QueryListEditingConfig<T>, 'onSubmit' | 'onCancel'>;\n\nexport type QueryListRowRenderData<T extends QueryListRow = QueryListRow> = {\n item: QueryListItem<T>;\n index: number;\n isActive: boolean;\n variant: QueryListRowVariant;\n comparison?: {\n enabled: boolean;\n checked: boolean;\n };\n visibleFields?: QueryListVisibleFieldsConfig<T>;\n actions?: QueryListRowAction<T>[];\n editing?: QueryListEditingRenderData<T>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -8,7 +8,6 @@ import "core-js/modules/es.string.search.js";
8
8
  import React from 'react';
9
9
  import cn from 'bem-cn-lite';
10
10
  import { QueriesList } from "../../modules";
11
- import i18n from "./i18n";
12
11
  import { HistoryRowContent } from "./internal/HistoryRowContent";
13
12
  import "./QueriesHistory.css";
14
13
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -29,7 +28,7 @@ export var QueriesHistory = function QueriesHistory(_ref) {
29
28
  className = _ref.className;
30
29
  return /*#__PURE__*/_jsx(QueriesList, {
31
30
  className: block(null, className),
32
- title: title || i18n('title_history'),
31
+ title: title,
33
32
  logo: logo,
34
33
  search: search,
35
34
  filter: filter,
@@ -1 +1 @@
1
- {"version":3,"names":["React","cn","QueriesList","i18n","HistoryRowContent","jsx","_jsx","block","QueriesHistory","_ref","title","logo","search","filter","items","selectedRowId","editing","comparison","visibleFields","renderRowItem","getRowActions","onListItemClick","className","renderRow","data","_objectSpread"],"sources":["QueriesHistory.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'bem-cn-lite';\nimport {QueriesList} from '../../modules';\nimport i18n from './i18n';\nimport {\n QueryListComparisonConfig,\n QueryListEditingConfig,\n QueryListFilterConfig,\n QueryListItem,\n QueryListRowAction,\n QueryListRowRenderData,\n QueryListSearchConfig,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\nimport {HistoryRowContent} from './internal/HistoryRowContent';\nimport './QueriesHistory.scss';\n\nexport type QueriesHistoryProps<T extends QueryHistoryRow = QueryHistoryRow> = {\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 editing?: QueryListEditingConfig<T>;\n comparison?: QueryListComparisonConfig<T>;\n visibleFields?: QueryListVisibleFieldsConfig<T>;\n renderRowItem?: (data: QueryListRowRenderData<T>) => React.ReactNode;\n getRowActions?: (item: T) => QueryListRowAction<T>[];\n onListItemClick?: (item: QueryListItem<T>) => void;\n};\n\nconst block = cn('qp-query-history');\n\nexport const QueriesHistory = <T extends QueryHistoryRow>({\n title,\n logo,\n search,\n filter,\n items,\n selectedRowId,\n editing,\n comparison,\n visibleFields,\n renderRowItem,\n getRowActions,\n onListItemClick,\n className,\n}: QueriesHistoryProps<T>) => {\n return (\n <QueriesList\n className={block(null, className)}\n title={title || i18n('title_history')}\n logo={logo}\n search={search}\n filter={filter}\n items={items}\n selectedRowId={selectedRowId}\n visibleFields={visibleFields}\n editing={editing}\n comparison={comparison}\n getRowActions={getRowActions}\n renderRow={(data) =>\n renderRowItem ? renderRowItem(data) : <HistoryRowContent {...data} />\n }\n onListItemClick={onListItemClick}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,aAAa;AAC5B,SAAQC,WAAW;AACnB,OAAOC,IAAI;AAYX,SAAQC,iBAAiB;AACzB;AAA+B,SAAAC,GAAA,IAAAC,IAAA;AAkB/B,IAAMC,KAAK,GAAGN,EAAE,CAAC,kBAAkB,CAAC;AAEpC,OAAO,IAAMO,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAcG;EAAA,IAb1BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IACNC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,OAAO,GAAAP,IAAA,CAAPO,OAAO;IACPC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,aAAa,GAAAT,IAAA,CAAbS,aAAa;IACbC,aAAa,GAAAV,IAAA,CAAbU,aAAa;IACbC,aAAa,GAAAX,IAAA,CAAbW,aAAa;IACbC,eAAe,GAAAZ,IAAA,CAAfY,eAAe;IACfC,SAAS,GAAAb,IAAA,CAATa,SAAS;EAET,oBACIhB,IAAA,CAACJ,WAAW;IACRoB,SAAS,EAAEf,KAAK,CAAC,IAAI,EAAEe,SAAS,CAAE;IAClCZ,KAAK,EAAEA,KAAK,IAAIP,IAAI,CAAC,eAAe,CAAE;IACtCQ,IAAI,EAAEA,IAAK;IACXC,MAAM,EAAEA,MAAO;IACfC,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbC,aAAa,EAAEA,aAAc;IAC7BG,aAAa,EAAEA,aAAc;IAC7BF,OAAO,EAAEA,OAAQ;IACjBC,UAAU,EAAEA,UAAW;IACvBG,aAAa,EAAEA,aAAc;IAC7BG,SAAS,EAAE,SAAXA,SAASA,CAAGC,IAAI;MAAA,OACZL,aAAa,GAAGA,aAAa,CAACK,IAAI,CAAC,gBAAGlB,IAAA,CAACF,iBAAiB,EAAAqB,aAAA,KAAKD,IAAI,CAAG,CAAC;IAAA,CACxE;IACDH,eAAe,EAAEA;EAAgB,CACpC,CAAC;AAEV,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","cn","QueriesList","HistoryRowContent","jsx","_jsx","block","QueriesHistory","_ref","title","logo","search","filter","items","selectedRowId","editing","comparison","visibleFields","renderRowItem","getRowActions","onListItemClick","className","renderRow","data","_objectSpread"],"sources":["QueriesHistory.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'bem-cn-lite';\nimport {QueriesList} from '../../modules';\nimport {\n QueryListComparisonConfig,\n QueryListEditingConfig,\n QueryListFilterConfig,\n QueryListItem,\n QueryListRowAction,\n QueryListRowRenderData,\n QueryListSearchConfig,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\nimport {HistoryRowContent} from './internal/HistoryRowContent';\nimport './QueriesHistory.scss';\n\nexport type QueriesHistoryProps<T extends QueryHistoryRow = QueryHistoryRow> = {\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 editing?: QueryListEditingConfig<T>;\n comparison?: QueryListComparisonConfig<T>;\n visibleFields?: QueryListVisibleFieldsConfig<T>;\n renderRowItem?: (data: QueryListRowRenderData<T>) => React.ReactNode;\n getRowActions?: (item: T) => QueryListRowAction<T>[];\n onListItemClick?: (item: QueryListItem<T>) => void;\n};\n\nconst block = cn('qp-query-history');\n\nexport const QueriesHistory = <T extends QueryHistoryRow>({\n title,\n logo,\n search,\n filter,\n items,\n selectedRowId,\n editing,\n comparison,\n visibleFields,\n renderRowItem,\n getRowActions,\n onListItemClick,\n className,\n}: QueriesHistoryProps<T>) => {\n return (\n <QueriesList\n className={block(null, className)}\n title={title}\n logo={logo}\n search={search}\n filter={filter}\n items={items}\n selectedRowId={selectedRowId}\n visibleFields={visibleFields}\n editing={editing}\n comparison={comparison}\n getRowActions={getRowActions}\n renderRow={(data) =>\n renderRowItem ? renderRowItem(data) : <HistoryRowContent {...data} />\n }\n onListItemClick={onListItemClick}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,aAAa;AAC5B,SAAQC,WAAW;AAYnB,SAAQC,iBAAiB;AACzB;AAA+B,SAAAC,GAAA,IAAAC,IAAA;AAkB/B,IAAMC,KAAK,GAAGL,EAAE,CAAC,kBAAkB,CAAC;AAEpC,OAAO,IAAMM,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAcG;EAAA,IAb1BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IACNC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,OAAO,GAAAP,IAAA,CAAPO,OAAO;IACPC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,aAAa,GAAAT,IAAA,CAAbS,aAAa;IACbC,aAAa,GAAAV,IAAA,CAAbU,aAAa;IACbC,aAAa,GAAAX,IAAA,CAAbW,aAAa;IACbC,eAAe,GAAAZ,IAAA,CAAfY,eAAe;IACfC,SAAS,GAAAb,IAAA,CAATa,SAAS;EAET,oBACIhB,IAAA,CAACH,WAAW;IACRmB,SAAS,EAAEf,KAAK,CAAC,IAAI,EAAEe,SAAS,CAAE;IAClCZ,KAAK,EAAEA,KAAM;IACbC,IAAI,EAAEA,IAAK;IACXC,MAAM,EAAEA,MAAO;IACfC,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbC,aAAa,EAAEA,aAAc;IAC7BG,aAAa,EAAEA,aAAc;IAC7BF,OAAO,EAAEA,OAAQ;IACjBC,UAAU,EAAEA,UAAW;IACvBG,aAAa,EAAEA,aAAc;IAC7BG,SAAS,EAAE,SAAXA,SAASA,CAAGC,IAAI;MAAA,OACZL,aAAa,GAAGA,aAAa,CAACK,IAAI,CAAC,gBAAGlB,IAAA,CAACF,iBAAiB,EAAAqB,aAAA,KAAKD,IAAI,CAAG,CAAC;IAAA,CACxE;IACDH,eAAe,EAAEA;EAAgB,CACpC,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof QueriesHistory>;
6
6
  export declare const Default: Story;
7
7
  export declare const Empty: Story;
8
+ export declare const WithHeader: Story;
@@ -12,6 +12,7 @@ import "core-js/modules/es.iterator.filter.js";
12
12
  import "core-js/modules/es.object.to-string.js";
13
13
  import "core-js/modules/es.string.includes.js";
14
14
  import React, { useState } from 'react';
15
+ import { SegmentedRadioGroup } from '@gravity-ui/uikit';
15
16
  import { QueriesHistory } from "./QueriesHistory";
16
17
  import { action } from 'storybook/actions';
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -72,6 +73,33 @@ var BASE_ITEMS = [{
72
73
  startTime: now - 30 * 60 * min,
73
74
  query: QUERY,
74
75
  height: 52
76
+ }, {
77
+ id: 6,
78
+ title: 'Query 6',
79
+ status: 'draft',
80
+ engine: 'YQL',
81
+ mode: 'Test',
82
+ startTime: now - 30 * 60 * min,
83
+ query: QUERY,
84
+ height: 52
85
+ }, {
86
+ id: 7,
87
+ title: 'Query 7',
88
+ status: 'draft',
89
+ engine: 'YQL',
90
+ mode: 'Test',
91
+ startTime: now - 30 * 60 * min,
92
+ query: QUERY,
93
+ height: 52
94
+ }, {
95
+ id: 8,
96
+ title: 'Query 8',
97
+ status: 'draft',
98
+ engine: 'YQL',
99
+ mode: 'Test',
100
+ startTime: now - 30 * 60 * min,
101
+ query: QUERY,
102
+ height: 52
75
103
  }];
76
104
  var activeFields = ['duration', 'mode', 'startTime', 'engine', 'isPrivate'];
77
105
  var fields = [{
@@ -122,6 +150,13 @@ var meta = {
122
150
  layout: 'padded'
123
151
  }
124
152
  };
153
+ var operationFilterOptions = [{
154
+ value: 'My',
155
+ content: 'My'
156
+ }, {
157
+ value: 'All',
158
+ content: 'All'
159
+ }];
125
160
  export default meta;
126
161
  var DefaultStory = function DefaultStory() {
127
162
  var _useState = useState([].concat(BASE_ITEMS)),
@@ -277,6 +312,47 @@ var EmptyStory = function EmptyStory() {
277
312
  })
278
313
  });
279
314
  };
315
+ var WithHeaderStory = function WithHeaderStory() {
316
+ var _useState13 = useState({
317
+ value: '',
318
+ fullSearch: false
319
+ }),
320
+ _useState14 = _slicedToArray(_useState13, 2),
321
+ search = _useState14[0],
322
+ setSearch = _useState14[1];
323
+ var _useState15 = useState(activeFields),
324
+ _useState16 = _slicedToArray(_useState15, 2),
325
+ visibleFields = _useState16[0],
326
+ setVisibleFields = _useState16[1];
327
+ return /*#__PURE__*/_jsx("div", {
328
+ style: {
329
+ width: 300,
330
+ height: 500
331
+ },
332
+ children: /*#__PURE__*/_jsx(QueriesHistory, {
333
+ items: BASE_ITEMS,
334
+ logo: /*#__PURE__*/_jsx(SegmentedRadioGroup, {
335
+ options: operationFilterOptions
336
+ }),
337
+ visibleFields: {
338
+ value: visibleFields,
339
+ fields: fields,
340
+ onChange: setVisibleFields
341
+ },
342
+ filter: {
343
+ fields: filterFields,
344
+ onApply: logFilterApply,
345
+ onReset: logFilterReset('reset')
346
+ },
347
+ search: {
348
+ value: search.value,
349
+ fullSearch: search.fullSearch,
350
+ hasClear: true,
351
+ onUpdate: setSearch
352
+ }
353
+ })
354
+ });
355
+ };
280
356
  export var Default = {
281
357
  render: function render() {
282
358
  return /*#__PURE__*/_jsx(DefaultStory, {});
@@ -287,4 +363,9 @@ export var Empty = {
287
363
  return /*#__PURE__*/_jsx(EmptyStory, {});
288
364
  }
289
365
  };
366
+ export var WithHeader = {
367
+ render: function render() {
368
+ return /*#__PURE__*/_jsx(WithHeaderStory, {});
369
+ }
370
+ };
290
371
  // #sourceMappingURL=QueriesHistory.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","QueriesHistory","action","jsx","_jsx","now","Date","min","QUERY","BASE_ITEMS","header","height","id","title","status","engine","mode","startTime","endTime","query","activeFields","fields","filterFields","type","initialValue","items","logFilterApply","logFilterReset","meta","component","tags","parameters","layout","DefaultStory","_useState","concat","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","_useState5","_useState6","visibleFields","setVisibleFields","_useState7","_useState8","compareMode","setCompareMode","_useState9","_useState0","comparedRows","setComparedRows","_useState1","undefined","_useState10","editingId","setEditingId","handleCompareChange","item","selected","result","_toConsumableArray","slice","filter","length","handleCompareCancel","handleEditSubmit","index","findIndex","i","_objectSpread","handleEditCancel","handleCompare","handleOnSearch","data","newItems","_item$query","toLowerCase","searchValue","includes","style","width","children","onChange","hasClear","onUpdate","onApply","onReset","getRowActions","text","onClick","comparison","enabled","comparedRowIds","onCancel","onCompare","editing","rowId","onSubmit","EmptyStory","_useState11","_useState12","Default","render","Empty"],"sources":["QueriesHistory.stories.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {QueriesHistory} from './QueriesHistory';\nimport {\n QueryListFieldKey,\n QueryListFilterConfig,\n QueryListItem,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\nimport {action} from 'storybook/actions';\n\nconst now = Date.now();\nconst min = 60 * 1000;\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 BASE_ITEMS: QueryListItem<QueryHistoryRow>[] = [\n {header: 'Today', height: 28},\n {\n id: 1,\n title: 'Query 1',\n status: 'completed',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 2 * min,\n endTime: now - min,\n query: QUERY,\n height: 52,\n },\n {\n id: 2,\n title: 'Query 2',\n status: 'failed',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 10 * min,\n endTime: now - 9 * min,\n query: QUERY,\n height: 52,\n },\n {\n id: 3,\n title: 'Query 3',\n status: 'running',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - min,\n query: QUERY,\n height: 52,\n },\n {header: 'Yesterday', height: 28},\n {\n id: 4,\n title: 'Query 4',\n status: 'aborted',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 25 * 60 * min,\n endTime: now - 24 * 60 * min,\n query: 'SELECT 1',\n height: 52,\n },\n {\n id: 5,\n title: 'Query 5',\n status: 'draft',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 30 * 60 * min,\n query: QUERY,\n height: 52,\n },\n];\n\ntype VisibleFields = QueryListVisibleFieldsConfig<QueryHistoryRow>['fields'];\nconst activeFields: QueryListFieldKey<QueryHistoryRow>[] = [\n 'duration',\n 'mode',\n 'startTime',\n 'engine',\n 'isPrivate',\n];\nconst fields: VisibleFields = [\n {\n id: 'duration',\n title: 'Duration',\n },\n {\n id: 'mode',\n title: 'Mode',\n },\n {\n id: 'startTime',\n title: 'Start time',\n },\n {\n id: 'engine',\n title: 'Engine',\n },\n {\n id: 'isPrivate',\n title: 'ACO',\n },\n];\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 meta: Meta<typeof QueriesHistory> = {\n title: 'Widgets/QueriesHistory',\n component: QueriesHistory,\n tags: ['autodocs'],\n parameters: {\n layout: 'padded',\n },\n};\n\nexport default meta;\ntype Story = StoryObj<typeof QueriesHistory>;\n\nconst DefaultStory = () => {\n const [items, setItems] = useState([...BASE_ITEMS]);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] =\n useState<QueryListFieldKey<QueryHistoryRow>[]>(activeFields);\n const [compareMode, setCompareMode] = useState(false);\n const [comparedRows, setComparedRows] = useState<number[]>([]);\n const [editingId, setEditingId] = useState<number | undefined>(undefined);\n\n const handleCompareChange = (item: QueryHistoryRow, selected: boolean) => {\n const result = selected\n ? [...comparedRows.slice(0, 1), item.id]\n : comparedRows.filter((id) => id !== item.id);\n setComparedRows(result);\n\n if (!result.length) setCompareMode(false);\n };\n\n const handleCompareCancel = () => {\n setComparedRows([]);\n setCompareMode(false);\n };\n\n const handleEditSubmit = (item: QueryHistoryRow, title: string) => {\n const index = items.findIndex((i) => 'id' in i && i.id === item.id);\n if (index < 0) return;\n\n const result = [...items];\n result[index] = {...result[index], title};\n setItems(result);\n setEditingId(undefined);\n };\n\n const handleEditCancel = () => {\n setEditingId(undefined);\n };\n\n const handleCompare = () => {\n action('onCompare')(comparedRows);\n };\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 <QueriesHistory\n title=\"History\"\n items={items}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: handleOnSearch,\n }}\n filter={{\n fields: filterFields,\n onApply: logFilterApply,\n onReset: logFilterReset('reset'),\n }}\n getRowActions={() => [\n {\n text: 'Compare',\n onClick: (item) => {\n setCompareMode(true);\n setComparedRows([item.id]);\n },\n },\n {\n text: 'Edit',\n onClick: (item) => {\n setEditingId(item.id);\n },\n },\n ]}\n comparison={{\n enabled: compareMode,\n comparedRowIds: comparedRows,\n onChange: handleCompareChange,\n onCancel: handleCompareCancel,\n onCompare: handleCompare,\n }}\n editing={{\n rowId: editingId,\n onSubmit: handleEditSubmit,\n onCancel: handleEditCancel,\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 <QueriesHistory\n title=\"History\"\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,cAAc;AAQtB,SAAQC,MAAM,QAAO,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,IAAMC,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,CAAC;AACtB,IAAME,GAAG,GAAG,EAAE,GAAG,IAAI;AAErB,IAAMC,KAAK,6IAKmC;AAE9C,IAAMC,UAA4C,GAAG,CACjD;EAACC,MAAM,EAAE,OAAO;EAAEC,MAAM,EAAE;AAAE,CAAC,EAC7B;EACIC,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,SAAS;EAChBC,MAAM,EAAE,WAAW;EACnBC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE,YAAY;EAClBC,S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GAAG;MAAE3E,MAAM,EAAE;IAAG,CAAE;IAAA4E,QAAA,eAClCnF,IAAA,CAACH,cAAc;MACXY,KAAK,EAAC,SAAS;MACfY,KAAK,EAAE,EAAG;MACVkB,MAAM,EAAE;QACJH,KAAK,EAAEG,MAAM,CAACH,KAAK;QACnBC,UAAU,EAAEE,MAAM,CAACF,UAAU;QAC7BgD,QAAQ,EAAE,IAAI;QACdC,QAAQ,EAAE9C;MACd;IAAE,CACL;EAAC,CACD,CAAC;AAEd,CAAC;AAED,OAAO,IAAM+D,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQxG,IAAA,CAAC6B,YAAY,IAAE,CAAC;EAAA;AAAA,CAAC;AAC9D,OAAO,IAAM4E,KAAY,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQxG,IAAA,CAACoG,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useState","SegmentedRadioGroup","QueriesHistory","action","jsx","_jsx","now","Date","min","QUERY","BASE_ITEMS","header","height","id","title","status","engine","mode","startTime","endTime","query","activeFields","fields","filterFields","type","initialValue","items","logFilterApply","logFilterReset","meta","component","tags","parameters","layout","operationFilterOptions","value","content","DefaultStory","_useState","concat","_useState2","_slicedToArray","setItems","_useState3","fullSearch","_useState4","search","setSearch","_useState5","_useState6","visibleFields","setVisibleFields","_useState7","_useState8","compareMode","setCompareMode","_useState9","_useState0","comparedRows","setComparedRows","_useState1","undefined","_useState10","editingId","setEditingId","handleCompareChange","item","selected","result","_toConsumableArray","slice","filter","length","handleCompareCancel","handleEditSubmit","index","findIndex","i","_objectSpread","handleEditCancel","handleCompare","handleOnSearch","data","newItems","_item$query","toLowerCase","searchValue","includes","style","width","children","onChange","hasClear","onUpdate","onApply","onReset","getRowActions","text","onClick","comparison","enabled","comparedRowIds","onCancel","onCompare","editing","rowId","onSubmit","EmptyStory","_useState11","_useState12","WithHeaderStory","_useState13","_useState14","_useState15","_useState16","logo","options","Default","render","Empty","WithHeader"],"sources":["QueriesHistory.stories.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {SegmentedRadioGroup} from '@gravity-ui/uikit';\nimport {QueriesHistory} from './QueriesHistory';\nimport {\n QueryListFieldKey,\n QueryListFilterConfig,\n QueryListItem,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\nimport {action} from 'storybook/actions';\n\nconst now = Date.now();\nconst min = 60 * 1000;\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 BASE_ITEMS: QueryListItem<QueryHistoryRow>[] = [\n {header: 'Today', height: 28},\n {\n id: 1,\n title: 'Query 1',\n status: 'completed',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 2 * min,\n endTime: now - min,\n query: QUERY,\n height: 52,\n },\n {\n id: 2,\n title: 'Query 2',\n status: 'failed',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 10 * min,\n endTime: now - 9 * min,\n query: QUERY,\n height: 52,\n },\n {\n id: 3,\n title: 'Query 3',\n status: 'running',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - min,\n query: QUERY,\n height: 52,\n },\n {header: 'Yesterday', height: 28},\n {\n id: 4,\n title: 'Query 4',\n status: 'aborted',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 25 * 60 * min,\n endTime: now - 24 * 60 * min,\n query: 'SELECT 1',\n height: 52,\n },\n {\n id: 5,\n title: 'Query 5',\n status: 'draft',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 30 * 60 * min,\n query: QUERY,\n height: 52,\n },\n {\n id: 6,\n title: 'Query 6',\n status: 'draft',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 30 * 60 * min,\n query: QUERY,\n height: 52,\n },\n {\n id: 7,\n title: 'Query 7',\n status: 'draft',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 30 * 60 * min,\n query: QUERY,\n height: 52,\n },\n {\n id: 8,\n title: 'Query 8',\n status: 'draft',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 30 * 60 * min,\n query: QUERY,\n height: 52,\n },\n];\n\ntype VisibleFields = QueryListVisibleFieldsConfig<QueryHistoryRow>['fields'];\nconst activeFields: QueryListFieldKey<QueryHistoryRow>[] = [\n 'duration',\n 'mode',\n 'startTime',\n 'engine',\n 'isPrivate',\n];\nconst fields: VisibleFields = [\n {\n id: 'duration',\n title: 'Duration',\n },\n {\n id: 'mode',\n title: 'Mode',\n },\n {\n id: 'startTime',\n title: 'Start time',\n },\n {\n id: 'engine',\n title: 'Engine',\n },\n {\n id: 'isPrivate',\n title: 'ACO',\n },\n];\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 meta: Meta<typeof QueriesHistory> = {\n title: 'Widgets/QueriesHistory',\n component: QueriesHistory,\n tags: ['autodocs'],\n parameters: {\n layout: 'padded',\n },\n};\n\nconst operationFilterOptions = [\n {\n value: 'My',\n content: 'My',\n },\n {\n value: 'All',\n content: 'All',\n },\n];\n\nexport default meta;\ntype Story = StoryObj<typeof QueriesHistory>;\n\nconst DefaultStory = () => {\n const [items, setItems] = useState([...BASE_ITEMS]);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] =\n useState<QueryListFieldKey<QueryHistoryRow>[]>(activeFields);\n const [compareMode, setCompareMode] = useState(false);\n const [comparedRows, setComparedRows] = useState<(number | string)[]>([]);\n const [editingId, setEditingId] = useState<number | string | undefined>(undefined);\n\n const handleCompareChange = (item: QueryHistoryRow, selected: boolean) => {\n const result = selected\n ? [...comparedRows.slice(0, 1), item.id]\n : comparedRows.filter((id) => id !== item.id);\n setComparedRows(result);\n\n if (!result.length) setCompareMode(false);\n };\n\n const handleCompareCancel = () => {\n setComparedRows([]);\n setCompareMode(false);\n };\n\n const handleEditSubmit = (item: QueryHistoryRow, title: string) => {\n const index = items.findIndex((i) => 'id' in i && i.id === item.id);\n if (index < 0) return;\n\n const result = [...items];\n result[index] = {...result[index], title};\n setItems(result);\n setEditingId(undefined);\n };\n\n const handleEditCancel = () => {\n setEditingId(undefined);\n };\n\n const handleCompare = () => {\n action('onCompare')(comparedRows);\n };\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 <QueriesHistory\n title=\"History\"\n items={items}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: handleOnSearch,\n }}\n filter={{\n fields: filterFields,\n onApply: logFilterApply,\n onReset: logFilterReset('reset'),\n }}\n getRowActions={() => [\n {\n text: 'Compare',\n onClick: (item) => {\n setCompareMode(true);\n setComparedRows([item.id]);\n },\n },\n {\n text: 'Edit',\n onClick: (item) => {\n setEditingId(item.id);\n },\n },\n ]}\n comparison={{\n enabled: compareMode,\n comparedRowIds: comparedRows,\n onChange: handleCompareChange,\n onCancel: handleCompareCancel,\n onCompare: handleCompare,\n }}\n editing={{\n rowId: editingId,\n onSubmit: handleEditSubmit,\n onCancel: handleEditCancel,\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 <QueriesHistory\n title=\"History\"\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\nconst WithHeaderStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] =\n useState<QueryListFieldKey<QueryHistoryRow>[]>(activeFields);\n\n return (\n <div style={{width: 300, height: 500}}>\n <QueriesHistory\n items={BASE_ITEMS}\n logo={<SegmentedRadioGroup options={operationFilterOptions} />}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\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: setSearch,\n }}\n />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <DefaultStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\nexport const WithHeader: Story = {render: () => <WithHeaderStory />};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAGC,QAAQ,QAAO,OAAO;AAErC,SAAQC,mBAAmB,QAAO,mBAAmB;AACrD,SAAQC,cAAc;AAQtB,SAAQC,MAAM,QAAO,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,IAAMC,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,CAAC;AACtB,IAAME,GAAG,GAAG,EAAE,GAAG,IAAI;AAErB,IAAMC,KAAK,6IAKmC;AAE9C,IAAMC,UAA4C,GAAG,CACjD;EAACC,MAAM,EAAE,OAAO;EAAEC,MAAM,EAAE;AAAE,CAAC,EAC7B;EACIC,EAAE,EAAE,CAAC;EACLC,KAAK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A,CAAA;IAAA,oBAAQjH,IAAA,CAACgC,YAAY,IAAE,CAAC;EAAA;AAAA,CAAC;AAC9D,OAAO,IAAMkF,KAAY,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQjH,IAAA,CAACsG,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC;AAC1D,OAAO,IAAMa,UAAiB,GAAG;EAACF,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQjH,IAAA,CAACyG,eAAe,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","useState","Text","action","SavedQueries","jsx","_jsx","QUERY","BASE_ITEMS","id","title","savedAt","engine","author","query","height","filterFields","type","initialValue","items","fields","meta","component","tags","parameters","layout","SavedQueriesStory","_useState","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","_useState5","_useState6","visibleFields","setVisibleFields","_useState7","_useState8","comparedRowIds","setComparedRowIds","_useState9","_useState0","editingRowId","setEditingRowId","filteredItems","toLowerCase","filter","item","_item$query","includes","updateTitle","currentItems","map","currentItem","_objectSpread","undefined","style","width","children","hasClear","onUpdate","onApply","onReset","onChange","editing","rowId","onSubmit","onCancel","comparison","enabled","Boolean","length","selected","currentIds","concat","_toConsumableArray","slice","onCompare","getRowActions","text","onClick","theme","CustomAuthorStory","team","_useState1","_useState10","renderAuthor","color","EmptyStory","_useState11","_useState12","Default","render","CustomAuthor","Empty"],"sources":["SavedQueries.stories.tsx"],"sourcesContent":["import React, {useMemo, useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {Text} from '@gravity-ui/uikit';\nimport {action} from 'storybook/actions';\nimport {\n QueryListFieldKey,\n QueryListFilterConfig,\n QueryListItem,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {SavedQuery} from '../../types/savedQueries';\nimport {SavedQueries} from './SavedQueries';\n\nconst QUERY = `SELECT\n session_id,\n COUNT(*) AS sessions_count\nFROM visits\nGROUP BY session_id;`;\n\nconst BASE_ITEMS: QueryListItem<SavedQuery>[] = [\n {\n id: 1,\n title: 'New Query',\n savedAt: '2026-04-29T12:00:00.000Z',\n engine: 'SQL',\n author: 'Anna Petrova',\n query: QUERY,\n height: 52,\n },\n {\n id: 2,\n title: 'Daily conversion report',\n savedAt: '2026-04-29T11:00:00.000Z',\n engine: 'YQL',\n author: 'Pavel Sidorov',\n query: QUERY,\n height: 52,\n },\n {\n id: 3,\n title: 'Product funnel',\n savedAt: '2026-04-28T09:00:00.000Z',\n engine: 'SQL',\n author: 'Maria Volkova',\n query: 'SELECT 1;',\n height: 52,\n },\n];\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: 'engine',\n type: 'checkboxGroup',\n title: 'Engine',\n initialValue: [],\n items: [\n {id: 'yql', title: 'YQL'},\n {id: 'sql', title: 'SQL'},\n ],\n },\n];\n\nconst fields: QueryListVisibleFieldsConfig<SavedQuery>['fields'] = [\n {id: 'savedAt', title: 'Saved date'},\n {id: 'engine', title: 'Engine'},\n {id: 'author', title: 'Author'},\n];\n\nconst meta: Meta<typeof SavedQueries> = {\n title: 'Widgets/SavedQueries',\n component: SavedQueries,\n tags: ['autodocs'],\n parameters: {layout: 'padded'},\n};\n\nexport default meta;\ntype Story = StoryObj<typeof SavedQueries>;\n\nconst SavedQueriesStory = () => {\n const [items, setItems] = useState(BASE_ITEMS);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] = useState<QueryListFieldKey<SavedQuery>[]>([\n 'savedAt',\n 'engine',\n 'author',\n ]);\n const [comparedRowIds, setComparedRowIds] = useState<number[]>([]);\n const [editingRowId, setEditingRowId] = useState<number>();\n\n const filteredItems = useMemo(() => {\n if (!search.value) return items;\n\n const value = search.value.toLowerCase();\n return items.filter((item) => {\n if ('header' in item) return false;\n\n return search.fullSearch\n ? item.title.toLowerCase().includes(value) ||\n item.query?.toLowerCase().includes(value)\n : item.title.toLowerCase().includes(value);\n });\n }, [items, search]);\n\n const updateTitle = (item: SavedQuery, title: string) => {\n setItems((currentItems) =>\n currentItems.map((currentItem) =>\n 'id' in currentItem && currentItem.id === item.id\n ? {...currentItem, title}\n : currentItem,\n ),\n );\n setEditingRowId(undefined);\n };\n\n return (\n <div style={{width: 360, height: 560}}>\n <SavedQueries\n items={filteredItems}\n search={{...search, hasClear: true, onUpdate: setSearch}}\n filter={{\n fields: filterFields,\n onApply: action('onFilterApply'),\n onReset: action('onFilterReset'),\n }}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\n editing={{\n rowId: editingRowId,\n onSubmit: updateTitle,\n onCancel: () => setEditingRowId(undefined),\n }}\n comparison={{\n enabled: Boolean(comparedRowIds.length),\n comparedRowIds,\n onChange: (item, selected) => {\n setComparedRowIds((currentIds) =>\n selected\n ? [...currentIds.filter((id) => id !== item.id).slice(-1), item.id]\n : currentIds.filter((id) => id !== item.id),\n );\n },\n onCancel: () => setComparedRowIds([]),\n onCompare: () => action('onCompare')(comparedRowIds),\n }}\n getRowActions={(item) => [\n {text: 'Copy to', onClick: () => action('onCopyTo')(item)},\n {text: 'Show operations', onClick: () => action('onShowOperations')(item)},\n {text: 'Edit', onClick: () => setEditingRowId(item.id)},\n {\n text: 'Compare with baseline',\n onClick: () => setComparedRowIds([item.id]),\n },\n {text: 'Delete', theme: 'danger', onClick: () => action('onDelete')(item)},\n ]}\n />\n </div>\n );\n};\n\ntype ExtendedSavedQuery = SavedQuery & {team: string};\n\nconst CustomAuthorStory = () => {\n const items: QueryListItem<ExtendedSavedQuery>[] = BASE_ITEMS.map((item) =>\n 'header' in item ? item : {...item, team: 'Analytics'},\n );\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 360, height: 280}}>\n <SavedQueries\n items={items}\n search={{...search, hasClear: true, onUpdate: setSearch}}\n renderAuthor={(item) => <Text color=\"complementary\">{item.team}</Text>}\n />\n </div>\n );\n};\n\nconst EmptyStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 360, height: 280}}>\n <SavedQueries items={[]} search={{...search, hasClear: true, onUpdate: setSearch}} />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <SavedQueriesStory />};\nexport const CustomAuthor: Story = {render: () => <CustomAuthorStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAE9C,SAAQC,IAAI,QAAO,mBAAmB;AACtC,SAAQC,MAAM,QAAO,mBAAmB;AAQxC,SAAQC,YAAY;AAAwB,SAAAC,GAAA,IAAAC,IAAA;AAE5C,IAAMC,KAAK,+FAIU;AAErB,IAAMC,UAAuC,GAAG,CAC5C;EACIC,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,WAAW;EAClBC,OAAO,EAAE,0BAA0B;EACnCC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,cAAc;EACtBC,KAAK,EAAEP,KAAK;EACZQ,MAAM,EAAE;AACZ,CAAC,EACD;EACIN,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,yBAAyB;EAChCC,OAAO,EAAE,0BAA0B;EACnCC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,eAAe;EACvBC,KAAK,EAAEP,KAAK;EACZQ,MAAM,EAAE;AACZ,CAAC,EACD;EACIN,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,gBAAgB;EACvBC,OAAO,EAAE,0BAA0B;EACnCC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,eAAe;EACvBC,KAAK,EAAE,WAAW;EAClBC,MAAM,EAAE;AACZ,CAAC,CACJ;AAED,IAAMC,YAA6C,GAAG,CAClD;EAACP,EAAE,EAAE,UAAU;EAAEQ,IAAI,EAAE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C,CAC1E;EAAC,CACD,CAAC;AAEd,CAAC;AAED,IAAMK,UAAU,GAAG,SAAbA,UAAUA,CAAA,EAAS;EACrB,IAAAC,WAAA,GAA4B7F,QAAQ,CAAC;MAAC+B,KAAK,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAC,CAAC;IAAA8D,WAAA,GAAAlE,cAAA,CAAAiE,WAAA;IAA7D3D,MAAM,GAAA4D,WAAA;IAAE3D,SAAS,GAAA2D,WAAA;EAExB,oBACIzF,IAAA;IAAKuD,KAAK,EAAE;MAACC,KAAK,EAAE,GAAG;MAAE/C,MAAM,EAAE;IAAG,CAAE;IAAAgD,QAAA,eAClCzD,IAAA,CAACF,YAAY;MAACe,KAAK,EAAE,EAAG;MAACgB,MAAM,EAAAwB,aAAA,CAAAA,aAAA,KAAMxB,MAAM;QAAE6B,QAAQ,EAAE,IAAI;QAAEC,QAAQ,EAAE7B;MAAS;IAAE,CAAE;EAAC,CACpF,CAAC;AAEd,CAAC;AAED,OAAO,IAAM4D,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACoB,iBAAiB,IAAE,CAAC;EAAA;AAAA,CAAC;AACnE,OAAO,IAAMwE,YAAmB,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACiF,iBAAiB,IAAE,CAAC;EAAA;AAAA,CAAC;AACxE,OAAO,IAAMY,KAAY,GAAG;EAACF,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACuF,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","useState","Text","action","SavedQueries","jsx","_jsx","QUERY","BASE_ITEMS","id","title","savedAt","engine","author","query","height","filterFields","type","initialValue","items","fields","meta","component","tags","parameters","layout","SavedQueriesStory","_useState","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","_useState5","_useState6","visibleFields","setVisibleFields","_useState7","_useState8","comparedRowIds","setComparedRowIds","_useState9","_useState0","editingRowId","setEditingRowId","filteredItems","toLowerCase","filter","item","_item$query","includes","updateTitle","currentItems","map","currentItem","_objectSpread","undefined","style","width","children","hasClear","onUpdate","onApply","onReset","onChange","editing","rowId","onSubmit","onCancel","comparison","enabled","Boolean","length","selected","currentIds","concat","_toConsumableArray","slice","onCompare","getRowActions","text","onClick","theme","CustomAuthorStory","team","_useState1","_useState10","renderAuthor","color","EmptyStory","_useState11","_useState12","Default","render","CustomAuthor","Empty"],"sources":["SavedQueries.stories.tsx"],"sourcesContent":["import React, {useMemo, useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {Text} from '@gravity-ui/uikit';\nimport {action} from 'storybook/actions';\nimport {\n QueryListFieldKey,\n QueryListFilterConfig,\n QueryListItem,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {SavedQuery} from '../../types/savedQueries';\nimport {SavedQueries} from './SavedQueries';\n\nconst QUERY = `SELECT\n session_id,\n COUNT(*) AS sessions_count\nFROM visits\nGROUP BY session_id;`;\n\nconst BASE_ITEMS: QueryListItem<SavedQuery>[] = [\n {\n id: 1,\n title: 'New Query',\n savedAt: '2026-04-29T12:00:00.000Z',\n engine: 'SQL',\n author: 'Anna Petrova',\n query: QUERY,\n height: 52,\n },\n {\n id: 2,\n title: 'Daily conversion report',\n savedAt: '2026-04-29T11:00:00.000Z',\n engine: 'YQL',\n author: 'Pavel Sidorov',\n query: QUERY,\n height: 52,\n },\n {\n id: 3,\n title: 'Product funnel',\n savedAt: '2026-04-28T09:00:00.000Z',\n engine: 'SQL',\n author: 'Maria Volkova',\n query: 'SELECT 1;',\n height: 52,\n },\n];\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: 'engine',\n type: 'checkboxGroup',\n title: 'Engine',\n initialValue: [],\n items: [\n {id: 'yql', title: 'YQL'},\n {id: 'sql', title: 'SQL'},\n ],\n },\n];\n\nconst fields: QueryListVisibleFieldsConfig<SavedQuery>['fields'] = [\n {id: 'savedAt', title: 'Saved date'},\n {id: 'engine', title: 'Engine'},\n {id: 'author', title: 'Author'},\n];\n\nconst meta: Meta<typeof SavedQueries> = {\n title: 'Widgets/SavedQueries',\n component: SavedQueries,\n tags: ['autodocs'],\n parameters: {layout: 'padded'},\n};\n\nexport default meta;\ntype Story = StoryObj<typeof SavedQueries>;\n\nconst SavedQueriesStory = () => {\n const [items, setItems] = useState(BASE_ITEMS);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] = useState<QueryListFieldKey<SavedQuery>[]>([\n 'savedAt',\n 'engine',\n 'author',\n ]);\n const [comparedRowIds, setComparedRowIds] = useState<(number | string)[]>([]);\n const [editingRowId, setEditingRowId] = useState<number | string>();\n\n const filteredItems = useMemo(() => {\n if (!search.value) return items;\n\n const value = search.value.toLowerCase();\n return items.filter((item) => {\n if ('header' in item) return false;\n\n return search.fullSearch\n ? item.title.toLowerCase().includes(value) ||\n item.query?.toLowerCase().includes(value)\n : item.title.toLowerCase().includes(value);\n });\n }, [items, search]);\n\n const updateTitle = (item: SavedQuery, title: string) => {\n setItems((currentItems) =>\n currentItems.map((currentItem) =>\n 'id' in currentItem && currentItem.id === item.id\n ? {...currentItem, title}\n : currentItem,\n ),\n );\n setEditingRowId(undefined);\n };\n\n return (\n <div style={{width: 360, height: 560}}>\n <SavedQueries\n items={filteredItems}\n search={{...search, hasClear: true, onUpdate: setSearch}}\n filter={{\n fields: filterFields,\n onApply: action('onFilterApply'),\n onReset: action('onFilterReset'),\n }}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\n editing={{\n rowId: editingRowId,\n onSubmit: updateTitle,\n onCancel: () => setEditingRowId(undefined),\n }}\n comparison={{\n enabled: Boolean(comparedRowIds.length),\n comparedRowIds,\n onChange: (item, selected) => {\n setComparedRowIds((currentIds) =>\n selected\n ? [...currentIds.filter((id) => id !== item.id).slice(-1), item.id]\n : currentIds.filter((id) => id !== item.id),\n );\n },\n onCancel: () => setComparedRowIds([]),\n onCompare: () => action('onCompare')(comparedRowIds),\n }}\n getRowActions={(item) => [\n {text: 'Copy to', onClick: () => action('onCopyTo')(item)},\n {text: 'Show operations', onClick: () => action('onShowOperations')(item)},\n {text: 'Edit', onClick: () => setEditingRowId(item.id)},\n {\n text: 'Compare with baseline',\n onClick: () => setComparedRowIds([item.id]),\n },\n {text: 'Delete', theme: 'danger', onClick: () => action('onDelete')(item)},\n ]}\n />\n </div>\n );\n};\n\ntype ExtendedSavedQuery = SavedQuery & {team: string};\n\nconst CustomAuthorStory = () => {\n const items: QueryListItem<ExtendedSavedQuery>[] = BASE_ITEMS.map((item) =>\n 'header' in item ? item : {...item, team: 'Analytics'},\n );\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 360, height: 280}}>\n <SavedQueries\n items={items}\n search={{...search, hasClear: true, onUpdate: setSearch}}\n renderAuthor={(item) => <Text color=\"complementary\">{item.team}</Text>}\n />\n </div>\n );\n};\n\nconst EmptyStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 360, height: 280}}>\n <SavedQueries items={[]} search={{...search, hasClear: true, onUpdate: setSearch}} />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <SavedQueriesStory />};\nexport const CustomAuthor: Story = {render: () => <CustomAuthorStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAE9C,SAAQC,IAAI,QAAO,mBAAmB;AACtC,SAAQC,MAAM,QAAO,mBAAmB;AAQxC,SAAQC,YAAY;AAAwB,SAAAC,GAAA,IAAAC,IAAA;AAE5C,IAAMC,KAAK,+FAIU;AA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,EAAE7B;MAAS;IAAE,CAAE;EAAC,CACpF,CAAC;AAEd,CAAC;AAED,OAAO,IAAM4D,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACoB,iBAAiB,IAAE,CAAC;EAAA;AAAA,CAAC;AACnE,OAAO,IAAMwE,YAAmB,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACiF,iBAAiB,IAAE,CAAC;EAAA;AAAA,CAAC;AACxE,OAAO,IAAMY,KAAY,GAAG;EAACF,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACuF,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,8 +1,35 @@
1
1
  {
2
2
  "name": "@gravity-ui/querieskit",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Query page component library",
5
- "main": "build/index.js",
5
+ "main": "./build/cjs/index.js",
6
+ "module": "./build/esm/index.js",
7
+ "types": "./build/esm/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./build/esm/index.d.ts",
12
+ "default": "./build/esm/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./build/cjs/index.d.ts",
16
+ "default": "./build/cjs/index.js"
17
+ }
18
+ },
19
+ "./build/esm": {
20
+ "types": "./build/esm/index.d.ts",
21
+ "default": "./build/esm/index.js"
22
+ },
23
+ "./build/cjs": {
24
+ "types": "./build/cjs/index.d.ts",
25
+ "default": "./build/cjs/index.js"
26
+ },
27
+ "./build/*": "./build/*",
28
+ "./package.json": "./package.json"
29
+ },
30
+ "files": [
31
+ "build"
32
+ ],
6
33
  "scripts": {
7
34
  "build": "app-builder build",
8
35
  "lint": "eslint",
@@ -1,94 +0,0 @@
1
- ---
2
- name: code-review-checklist
3
- description: Review code changes from supplied diffs, local working-tree changes, or GitHub PRs, validating correctness, React state, edge cases, security, performance, and compatibility against full code context. Use for code review, diff review, logic checks, and bug hunting.
4
- ---
5
-
6
- # Code Review Checklist
7
-
8
- Review changes in two passes: find plausible risks, then validate each risk against the full code context. Report only confirmed, actionable findings.
9
-
10
- ## Boundaries
11
-
12
- - Code review is read-only unless the user separately asks for implementation.
13
- - Do not edit the reviewed code, create review-report files, or run commands that rewrite source files.
14
- - Do not publish PR comments, replies, or review decisions without an explicit request.
15
- - Return the review directly in the response, using the language of the user's request.
16
-
17
- ## Determine the Review Source
18
-
19
- Use the source named by the user. Do not ask them to reproduce a diff that is already available.
20
-
21
- - **Supplied diff or diff file:** treat it as the authoritative change set. When the repository is available, use it only to read the full files and related context.
22
- - **Local repository:** inspect status first. Unless the user narrows the scope, include staged changes, unstaged changes, and untracked files. If branch or committed changes are requested, compare the requested branch range as a separate layer.
23
- - **GitHub PR:** use the `github-pr-review` skill to obtain PR metadata, diff, and existing comments, then apply this skill as the analysis core. Preserve that skill's statuses when validating existing comments.
24
-
25
- An empty result from one diff layer does not prove there are no local changes; reconcile the review scope with repository status.
26
-
27
- ## Build Context Before Judging
28
-
29
- 1. Read the repository's `AGENTS.md` and any instructions that apply to the changed paths.
30
- 2. Build an internal change map in dependency order:
31
- types and helpers → components → modules → widgets → public exports and integration.
32
- 3. Read every changed source file in full when it is available, not only its diff hunks. If only the diff is available, state the resulting context limitation.
33
- 4. Follow relevant types, callers, callees, consumers, state owners, and public contracts when the finding depends on them.
34
- 5. Infer the intended behavior from code, tests, types, and the user's request. Call out a missing requirement as uncertainty, not as a confirmed bug.
35
-
36
- For this repository, apply conditional guidance without duplicating it here:
37
-
38
- - For SCSS or layout changes, read `plans/styles-rules.md`.
39
- - For localization changes, read `plans/i18n-rules.md`.
40
- - Check the `components → modules → widgets` dependency direction, mandatory unit and level barrel exports, and placement of consumer-facing public types described in `AGENTS.md`.
41
- - Treat documented legacy violations as anti-examples, not patterns to copy.
42
-
43
- ## Two-Pass Review
44
-
45
- ### Pass 1: Find Candidate Risks
46
-
47
- Look for code whose correctness depends on a non-obvious condition, including:
48
-
49
- - inverted, incomplete, unreachable, or off-by-one control flow;
50
- - invalid state transitions, direct mutation, stale closures, stale derived state, or incorrect React effect dependencies and cleanup;
51
- - nullish values, empty collections, Unicode, dates and time zones, size limits, and other realistic boundaries;
52
- - lost errors, incomplete failure paths, async races, interleaving, or cleanup leaks;
53
- - transformations that lose data or rely on an unvalidated shape or invariant;
54
- - broken request/response, component props, or public API contracts;
55
- - unsafe HTML or URLs, leaked secrets, or missing validation at trust boundaries;
56
- - unnecessary work in render or hot paths, retained listeners/resources, or avoidable large allocations;
57
- - breaking exports, incorrect abstraction-level imports, misplaced styles, or incomplete i18n changes.
58
-
59
- Do not turn formatting preferences, speculative possibilities, or generic best practices into findings without a concrete failure mode.
60
-
61
- ### Pass 2: Validate Every Candidate
62
-
63
- For each candidate:
64
-
65
- 1. Re-read the entire containing file and the relevant surrounding flow.
66
- 2. Verify the triggering input, state, or execution path is reachable.
67
- 3. Check whether types, callers, guards, framework behavior, or tests already preserve the invariant.
68
- 4. State the observable consequence and affected consumer.
69
- 5. Remove the candidate if the concern is disproved or remains purely speculative.
70
-
71
- Run relevant read-only checks when they materially increase confidence. Distinguish confirmed defects from test or verification gaps.
72
-
73
- ## Severity
74
-
75
- - **High:** security exposure, data loss, crash in a primary flow, or an unintended breaking public API change.
76
- - **Medium:** incorrect behavior in a realistic supported scenario, including significant state, error-handling, or integration failures.
77
- - **Low:** a limited edge-case defect or concrete maintainability problem likely to cause incorrect behavior later.
78
-
79
- Do not report style-only nits. Order findings from highest to lowest severity.
80
-
81
- ## Response Format
82
-
83
- Lead with confirmed findings. For each finding include:
84
-
85
- - **Location:** `path/to/file:line`
86
- - **Severity:** `High`, `Medium`, or `Low`
87
- - **Finding:** concise description of the defect
88
- - **Condition:** input or execution path that triggers it
89
- - **Impact:** observable consequence
90
- - **Recommendation:** specific fix or mitigation
91
-
92
- For existing PR comments, also include **Status** using the vocabulary required by `github-pr-review`.
93
-
94
- After findings, mention only material test or verification gaps. If there are no confirmed findings, say so explicitly and do not invent issues to fill the response.
@@ -1,24 +0,0 @@
1
- ---
2
- name: github-pr-review
3
- description: Reviews GitHub Pull Requests, analyzes diffs, and validates existing review comments for relevance. Use when the user provides a GitHub PR URL, asks to review a PR, поревьювить PR, проверить PR, or check whether existing review comments are still relevant.
4
- ---
5
-
6
- # GitHub PR Review & Validation Rule
7
-
8
- ## Работа со ссылкой на PR
9
- Когда предоставлена ссылка на GitHub PR:
10
- 1. **Анализ изменений**: Изучи diff и файлы, затронутые в PR.
11
- 2. **Применение чек-листа**: Используй критерии из skill `code-review-checklist` (Logical Bugs, Edge Cases, Security, Performance) для анализа входящего кода. Сначала прочитай `.agents/skills/code-review-checklist/SKILL.md`.
12
-
13
- ## Проверка существующих замечаний (Comments Validation)
14
- Если в PR уже есть комментарии/замечания от других ревьюеров:
15
- 1. **Релевантность**: Проверь, актуально ли ещё замечание. Если код уже исправлен в последних коммитах — отметь это.
16
- 2. **Объективность**: Сверь замечание с текущим чек-листом. Если замечание противоречит стандартам проекта или чек-листу, укажи на это.
17
-
18
- ## Формат ответа
19
- Для каждого замечания (нового или существующего из PR) используй формат:
20
- - **Локация**: [Файл : Строка]
21
- - **Статус**: (Новое / Подтверждено / Исправлено / Неактуально)
22
- - **Критичность**: (High / Medium / Low)
23
- - **Суть**: Краткое описание проблемы согласно чек-листу.
24
- - **Рекомендация**: Конкретный пример исправленного кода.