@gravity-ui/querieskit 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/build/cjs/components/AttachmentList/AttachmentList.js +1 -0
- package/build/cjs/components/AttachmentList/AttachmentList.js.map +1 -1
- package/build/cjs/components/QueryGraph/QueryGraph.css +70 -0
- package/build/cjs/components/QueryGraph/QueryGraph.css.map +1 -0
- package/build/cjs/components/QueryGraph/QueryGraph.d.ts +4 -0
- package/build/cjs/components/QueryGraph/QueryGraph.js +517 -0
- package/build/cjs/components/QueryGraph/QueryGraph.js.map +1 -0
- package/build/cjs/components/QueryGraph/QueryGraph.stories.d.ts +16 -0
- package/build/cjs/components/QueryGraph/QueryGraph.stories.js +339 -0
- package/build/cjs/components/QueryGraph/QueryGraph.stories.js.map +1 -0
- package/build/cjs/components/QueryGraph/helpers/layout.d.ts +9 -0
- package/build/cjs/components/QueryGraph/helpers/layout.js +138 -0
- package/build/cjs/components/QueryGraph/helpers/layout.js.map +1 -0
- package/build/cjs/components/QueryGraph/helpers/presentation.d.ts +18 -0
- package/build/cjs/components/QueryGraph/helpers/presentation.js +44 -0
- package/build/cjs/components/QueryGraph/helpers/presentation.js.map +1 -0
- package/build/cjs/components/QueryGraph/i18n/dicts.d.ts +55 -0
- package/build/cjs/components/QueryGraph/i18n/dicts.js +14 -0
- package/build/cjs/components/QueryGraph/i18n/dicts.js.map +1 -0
- package/build/cjs/components/QueryGraph/i18n/en.json +26 -0
- package/build/cjs/components/QueryGraph/i18n/index.d.ts +6 -0
- package/build/cjs/components/QueryGraph/i18n/index.js +11 -0
- package/build/cjs/components/QueryGraph/i18n/index.js.map +1 -0
- package/build/cjs/components/QueryGraph/i18n/ru.json +26 -0
- package/build/cjs/components/QueryGraph/index.d.ts +2 -0
- package/build/cjs/components/QueryGraph/index.js +13 -0
- package/build/cjs/components/QueryGraph/index.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.d.ts +24 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.js +307 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphCanvasBlock.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.d.ts +5 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.js +242 -0
- package/build/cjs/components/QueryGraph/internal/QueryGraphPopup.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/queryGraphIcons.d.ts +12 -0
- package/build/cjs/components/QueryGraph/internal/queryGraphIcons.js +161 -0
- package/build/cjs/components/QueryGraph/internal/queryGraphIcons.js.map +1 -0
- package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.d.ts +22 -0
- package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.js +60 -0
- package/build/cjs/components/QueryGraph/internal/useQueryGraphLayout.js.map +1 -0
- package/build/cjs/components/QueryGraph/story/largeGraphData.d.ts +3 -0
- package/build/cjs/components/QueryGraph/story/largeGraphData.js +227 -0
- package/build/cjs/components/QueryGraph/story/largeGraphData.js.map +1 -0
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +9 -1
- package/build/cjs/components/index.js.map +1 -1
- package/build/cjs/helpers/buildColumnsFromKeys.d.ts +1 -1
- package/build/cjs/helpers/buildColumnsFromKeys.js.map +1 -1
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +11 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/modules/Attachments/Attachments.css +13 -1
- package/build/cjs/modules/Attachments/Attachments.css.map +1 -1
- package/build/cjs/modules/Attachments/Attachments.js +4 -4
- package/build/cjs/modules/Attachments/Attachments.js.map +1 -1
- package/build/cjs/modules/Attachments/Attachments.stories.d.ts +1 -0
- package/build/cjs/modules/Attachments/Attachments.stories.js +92 -2
- package/build/cjs/modules/Attachments/Attachments.stories.js.map +1 -1
- package/build/cjs/modules/ClustersList/ClustersList.d.ts +1 -1
- package/build/cjs/modules/ClustersList/ClustersList.js +4 -3
- package/build/cjs/modules/ClustersList/ClustersList.js.map +1 -1
- package/build/cjs/modules/HistoryHeader/HistoryHeader.js +4 -3
- package/build/cjs/modules/HistoryHeader/HistoryHeader.js.map +1 -1
- package/build/cjs/modules/HistoryRow/HistoryRow.js +12 -7
- package/build/cjs/modules/HistoryRow/HistoryRow.js.map +1 -1
- package/build/cjs/modules/HistorySearchRow/HistorySearchRow.js +8 -5
- package/build/cjs/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
- package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.d.ts +1 -1
- package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js +5 -5
- package/build/cjs/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js.map +1 -1
- package/build/cjs/modules/NavigationDetail/NavigationDetail.d.ts +1 -1
- package/build/cjs/modules/NavigationDetail/NavigationDetail.js +2 -2
- package/build/cjs/modules/NavigationDetail/NavigationDetail.js.map +1 -1
- package/build/cjs/modules/NavigationHeader/NavigationHeader.d.ts +1 -1
- package/build/cjs/modules/NavigationHeader/NavigationHeader.js +2 -2
- package/build/cjs/modules/NavigationHeader/NavigationHeader.js.map +1 -1
- package/build/cjs/modules/NavigationItemsList/NavigationItemsList.d.ts +1 -1
- package/build/cjs/modules/NavigationItemsList/NavigationItemsList.js +4 -3
- package/build/cjs/modules/NavigationItemsList/NavigationItemsList.js.map +1 -1
- package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.d.ts +1 -1
- package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js +2 -2
- package/build/cjs/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js.map +1 -1
- package/build/cjs/modules/NavigationMeta/NavigationMeta.js +4 -3
- package/build/cjs/modules/NavigationMeta/NavigationMeta.js.map +1 -1
- package/build/cjs/modules/NavigationMeta/i18n/index.d.ts +2 -2
- package/build/cjs/modules/NavigationPreview/NavigationPreview.d.ts +1 -1
- package/build/cjs/modules/NavigationPreview/NavigationPreview.js +6 -4
- package/build/cjs/modules/NavigationPreview/NavigationPreview.js.map +1 -1
- package/build/cjs/modules/NavigationPreview/helpers/buildPreviewColumns.d.ts +1 -1
- package/build/cjs/modules/NavigationPreview/helpers/buildPreviewColumns.js.map +1 -1
- package/build/cjs/modules/NavigationSchema/NavigationSchema.d.ts +1 -1
- package/build/cjs/modules/NavigationSchema/NavigationSchema.js +4 -3
- package/build/cjs/modules/NavigationSchema/NavigationSchema.js.map +1 -1
- package/build/cjs/modules/NavigationSchema/helpers/buildSchemaColumns.d.ts +1 -1
- package/build/cjs/modules/NavigationSchema/helpers/buildSchemaColumns.js.map +1 -1
- package/build/cjs/modules/NavigationView/NavigationView.d.ts +1 -1
- package/build/cjs/modules/NavigationView/NavigationView.js +4 -3
- package/build/cjs/modules/NavigationView/NavigationView.js.map +1 -1
- package/build/cjs/modules/NavigationView/helpers/buildViewColumns.d.ts +1 -1
- package/build/cjs/modules/NavigationView/helpers/buildViewColumns.js.map +1 -1
- package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.d.ts +1 -1
- package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.js +4 -3
- package/build/cjs/modules/NavigationView/internal/NavigationViewSectionItem.js.map +1 -1
- package/build/cjs/modules/QueriesList/QueriesList.js +2 -2
- package/build/cjs/modules/QueriesList/QueriesList.js.map +1 -1
- package/build/cjs/modules/QueryProgress/QueryProgress.css +64 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.css.map +1 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.d.ts +4 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.js +135 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.js.map +1 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.stories.d.ts +7 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.stories.js +38 -0
- package/build/cjs/modules/QueryProgress/QueryProgress.stories.js.map +1 -0
- package/build/cjs/modules/QueryProgress/i18n/dicts.d.ts +25 -0
- package/build/cjs/modules/QueryProgress/i18n/dicts.js +14 -0
- package/build/cjs/modules/QueryProgress/i18n/dicts.js.map +1 -0
- package/build/cjs/modules/QueryProgress/i18n/en.json +11 -0
- package/build/cjs/modules/QueryProgress/i18n/index.d.ts +6 -0
- package/build/cjs/modules/QueryProgress/i18n/index.js +11 -0
- package/build/cjs/modules/QueryProgress/i18n/index.js.map +1 -0
- package/build/cjs/modules/QueryProgress/i18n/ru.json +11 -0
- package/build/cjs/modules/QueryProgress/index.d.ts +2 -0
- package/build/cjs/modules/QueryProgress/index.js +13 -0
- package/build/cjs/modules/QueryProgress/index.js.map +1 -0
- package/build/cjs/modules/QueryStatistics/i18n/index.d.ts +2 -2
- package/build/cjs/modules/RowsList/RowsList.js +4 -3
- package/build/cjs/modules/RowsList/RowsList.js.map +1 -1
- package/build/cjs/modules/SavedQueryRow/SavedQueryRow.d.ts +2 -2
- package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js +6 -4
- package/build/cjs/modules/SavedQueryRow/SavedQueryRow.js.map +1 -1
- package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +2 -2
- package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +4 -3
- package/build/cjs/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -1
- package/build/cjs/modules/TutorialRow/TutorialRow.d.ts +1 -1
- package/build/cjs/modules/TutorialRow/TutorialRow.js +2 -2
- package/build/cjs/modules/TutorialRow/TutorialRow.js.map +1 -1
- package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.d.ts +1 -1
- package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.js +4 -3
- package/build/cjs/modules/TutorialSearchRow/TutorialSearchRow.js.map +1 -1
- package/build/cjs/modules/index.d.ts +2 -0
- package/build/cjs/modules/index.js +8 -0
- package/build/cjs/modules/index.js.map +1 -1
- package/build/cjs/types/queryGraph.d.ts +87 -0
- package/build/cjs/types/queryGraph.js +6 -0
- package/build/cjs/types/queryGraph.js.map +1 -0
- package/build/cjs/widgets/DashboardCharts/DashboardCharts.js +8 -6
- package/build/cjs/widgets/DashboardCharts/DashboardCharts.js.map +1 -1
- package/build/cjs/widgets/DashboardCharts/types.d.ts +3 -3
- package/build/cjs/widgets/DashboardCharts/types.js.map +1 -1
- package/build/cjs/widgets/QueriesHistory/QueriesHistory.js +2 -2
- package/build/cjs/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
- package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.js +6 -5
- package/build/cjs/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -1
- package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.d.ts +1 -1
- package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.js +13 -9
- package/build/cjs/widgets/QueriesNavigation/QueriesNavigation.js.map +1 -1
- package/build/cjs/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js +2 -2
- package/build/cjs/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js.map +1 -1
- package/build/cjs/widgets/QueriesNavigation/helpers/createTableDetailConfig.js +8 -5
- package/build/cjs/widgets/QueriesNavigation/helpers/createTableDetailConfig.js.map +1 -1
- package/build/cjs/widgets/QueryResults/QueryResults.js +2 -2
- package/build/cjs/widgets/QueryResults/QueryResults.js.map +1 -1
- package/build/cjs/widgets/QueryResults/i18n/index.d.ts +2 -2
- package/build/cjs/widgets/QueryResults/internal/QueryResultsSchema.js +4 -3
- package/build/cjs/widgets/QueryResults/internal/QueryResultsSchema.js.map +1 -1
- package/build/cjs/widgets/SavedQueries/SavedQueries.d.ts +2 -2
- package/build/cjs/widgets/SavedQueries/SavedQueries.js +2 -2
- package/build/cjs/widgets/SavedQueries/SavedQueries.js.map +1 -1
- package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.d.ts +2 -2
- package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js +6 -5
- package/build/cjs/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -1
- package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
- package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js +6 -5
- package/build/cjs/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
- package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.d.ts +2 -2
- package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js +6 -4
- package/build/cjs/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
- package/build/esm/components/AttachmentList/AttachmentList.js +1 -0
- package/build/esm/components/AttachmentList/AttachmentList.js.map +1 -1
- package/build/esm/components/QueryGraph/QueryGraph.css +70 -0
- package/build/esm/components/QueryGraph/QueryGraph.css.map +1 -0
- package/build/esm/components/QueryGraph/QueryGraph.d.ts +4 -0
- package/build/esm/components/QueryGraph/QueryGraph.js +510 -0
- package/build/esm/components/QueryGraph/QueryGraph.js.map +1 -0
- package/build/esm/components/QueryGraph/QueryGraph.scss +81 -0
- package/build/esm/components/QueryGraph/QueryGraph.stories.d.ts +16 -0
- package/build/esm/components/QueryGraph/QueryGraph.stories.js +331 -0
- package/build/esm/components/QueryGraph/QueryGraph.stories.js.map +1 -0
- package/build/esm/components/QueryGraph/helpers/layout.d.ts +9 -0
- package/build/esm/components/QueryGraph/helpers/layout.js +128 -0
- package/build/esm/components/QueryGraph/helpers/layout.js.map +1 -0
- package/build/esm/components/QueryGraph/helpers/presentation.d.ts +18 -0
- package/build/esm/components/QueryGraph/helpers/presentation.js +35 -0
- package/build/esm/components/QueryGraph/helpers/presentation.js.map +1 -0
- package/build/esm/components/QueryGraph/i18n/dicts.d.ts +55 -0
- package/build/esm/components/QueryGraph/i18n/dicts.js +7 -0
- package/build/esm/components/QueryGraph/i18n/dicts.js.map +1 -0
- package/build/esm/components/QueryGraph/i18n/en.json +26 -0
- package/build/esm/components/QueryGraph/i18n/index.d.ts +6 -0
- package/build/esm/components/QueryGraph/i18n/index.js +4 -0
- package/build/esm/components/QueryGraph/i18n/index.js.map +1 -0
- package/build/esm/components/QueryGraph/i18n/ru.json +26 -0
- package/build/esm/components/QueryGraph/index.d.ts +2 -0
- package/build/esm/components/QueryGraph/index.js +2 -0
- package/build/esm/components/QueryGraph/index.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.d.ts +24 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js +299 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphCanvasBlock.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphPopup.d.ts +5 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js +234 -0
- package/build/esm/components/QueryGraph/internal/QueryGraphPopup.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/queryGraphIcons.d.ts +12 -0
- package/build/esm/components/QueryGraph/internal/queryGraphIcons.js +150 -0
- package/build/esm/components/QueryGraph/internal/queryGraphIcons.js.map +1 -0
- package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.d.ts +22 -0
- package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js +53 -0
- package/build/esm/components/QueryGraph/internal/useQueryGraphLayout.js.map +1 -0
- package/build/esm/components/QueryGraph/story/largeGraphData.d.ts +3 -0
- package/build/esm/components/QueryGraph/story/largeGraphData.js +220 -0
- package/build/esm/components/QueryGraph/story/largeGraphData.js.map +1 -0
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +1 -0
- package/build/esm/components/index.js.map +1 -1
- package/build/esm/helpers/buildColumnsFromKeys.d.ts +1 -1
- package/build/esm/helpers/buildColumnsFromKeys.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/modules/Attachments/Attachments.css +13 -1
- package/build/esm/modules/Attachments/Attachments.css.map +1 -1
- package/build/esm/modules/Attachments/Attachments.js +5 -5
- package/build/esm/modules/Attachments/Attachments.js.map +1 -1
- package/build/esm/modules/Attachments/Attachments.scss +13 -1
- package/build/esm/modules/Attachments/Attachments.stories.d.ts +1 -0
- package/build/esm/modules/Attachments/Attachments.stories.js +91 -1
- package/build/esm/modules/Attachments/Attachments.stories.js.map +1 -1
- package/build/esm/modules/ClustersList/ClustersList.d.ts +1 -1
- package/build/esm/modules/ClustersList/ClustersList.js +2 -1
- package/build/esm/modules/ClustersList/ClustersList.js.map +1 -1
- package/build/esm/modules/HistoryHeader/HistoryHeader.js +2 -1
- package/build/esm/modules/HistoryHeader/HistoryHeader.js.map +1 -1
- package/build/esm/modules/HistoryRow/HistoryRow.js +6 -1
- package/build/esm/modules/HistoryRow/HistoryRow.js.map +1 -1
- package/build/esm/modules/HistorySearchRow/HistorySearchRow.js +4 -1
- package/build/esm/modules/HistorySearchRow/HistorySearchRow.js.map +1 -1
- package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.d.ts +1 -1
- package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js +1 -1
- package/build/esm/modules/HistorySearchRow/helpers/resolveMonacoLanguage.js.map +1 -1
- package/build/esm/modules/NavigationDetail/NavigationDetail.d.ts +1 -1
- package/build/esm/modules/NavigationDetail/NavigationDetail.js +1 -1
- package/build/esm/modules/NavigationDetail/NavigationDetail.js.map +1 -1
- package/build/esm/modules/NavigationHeader/NavigationHeader.d.ts +1 -1
- package/build/esm/modules/NavigationHeader/NavigationHeader.js +1 -1
- package/build/esm/modules/NavigationHeader/NavigationHeader.js.map +1 -1
- package/build/esm/modules/NavigationItemsList/NavigationItemsList.d.ts +1 -1
- package/build/esm/modules/NavigationItemsList/NavigationItemsList.js +2 -1
- package/build/esm/modules/NavigationItemsList/NavigationItemsList.js.map +1 -1
- package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.d.ts +1 -1
- package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js +1 -1
- package/build/esm/modules/NavigationItemsList/internal/NavigationItemsListEmptyState.js.map +1 -1
- package/build/esm/modules/NavigationMeta/NavigationMeta.js +2 -1
- package/build/esm/modules/NavigationMeta/NavigationMeta.js.map +1 -1
- package/build/esm/modules/NavigationMeta/i18n/index.d.ts +2 -2
- package/build/esm/modules/NavigationPreview/NavigationPreview.d.ts +1 -1
- package/build/esm/modules/NavigationPreview/NavigationPreview.js +3 -1
- package/build/esm/modules/NavigationPreview/NavigationPreview.js.map +1 -1
- package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.d.ts +1 -1
- package/build/esm/modules/NavigationPreview/helpers/buildPreviewColumns.js.map +1 -1
- package/build/esm/modules/NavigationSchema/NavigationSchema.d.ts +1 -1
- package/build/esm/modules/NavigationSchema/NavigationSchema.js +2 -1
- package/build/esm/modules/NavigationSchema/NavigationSchema.js.map +1 -1
- package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.d.ts +1 -1
- package/build/esm/modules/NavigationSchema/helpers/buildSchemaColumns.js.map +1 -1
- package/build/esm/modules/NavigationView/NavigationView.d.ts +1 -1
- package/build/esm/modules/NavigationView/NavigationView.js +2 -1
- package/build/esm/modules/NavigationView/NavigationView.js.map +1 -1
- package/build/esm/modules/NavigationView/helpers/buildViewColumns.d.ts +1 -1
- package/build/esm/modules/NavigationView/helpers/buildViewColumns.js.map +1 -1
- package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.d.ts +1 -1
- package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js +2 -1
- package/build/esm/modules/NavigationView/internal/NavigationViewSectionItem.js.map +1 -1
- package/build/esm/modules/QueriesList/QueriesList.js +1 -1
- package/build/esm/modules/QueriesList/QueriesList.js.map +1 -1
- package/build/esm/modules/QueryProgress/QueryProgress.css +64 -0
- package/build/esm/modules/QueryProgress/QueryProgress.css.map +1 -0
- package/build/esm/modules/QueryProgress/QueryProgress.d.ts +4 -0
- package/build/esm/modules/QueryProgress/QueryProgress.js +127 -0
- package/build/esm/modules/QueryProgress/QueryProgress.js.map +1 -0
- package/build/esm/modules/QueryProgress/QueryProgress.scss +72 -0
- package/build/esm/modules/QueryProgress/QueryProgress.stories.d.ts +7 -0
- package/build/esm/modules/QueryProgress/QueryProgress.stories.js +31 -0
- package/build/esm/modules/QueryProgress/QueryProgress.stories.js.map +1 -0
- package/build/esm/modules/QueryProgress/i18n/dicts.d.ts +25 -0
- package/build/esm/modules/QueryProgress/i18n/dicts.js +7 -0
- package/build/esm/modules/QueryProgress/i18n/dicts.js.map +1 -0
- package/build/esm/modules/QueryProgress/i18n/en.json +11 -0
- package/build/esm/modules/QueryProgress/i18n/index.d.ts +6 -0
- package/build/esm/modules/QueryProgress/i18n/index.js +4 -0
- package/build/esm/modules/QueryProgress/i18n/index.js.map +1 -0
- package/build/esm/modules/QueryProgress/i18n/ru.json +11 -0
- package/build/esm/modules/QueryProgress/index.d.ts +2 -0
- package/build/esm/modules/QueryProgress/index.js +2 -0
- package/build/esm/modules/QueryProgress/index.js.map +1 -0
- package/build/esm/modules/QueryStatistics/i18n/index.d.ts +2 -2
- package/build/esm/modules/RowsList/RowsList.js +2 -1
- package/build/esm/modules/RowsList/RowsList.js.map +1 -1
- package/build/esm/modules/SavedQueryRow/SavedQueryRow.d.ts +2 -2
- package/build/esm/modules/SavedQueryRow/SavedQueryRow.js +3 -1
- package/build/esm/modules/SavedQueryRow/SavedQueryRow.js.map +1 -1
- package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.d.ts +2 -2
- package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js +2 -1
- package/build/esm/modules/SavedQuerySearchRow/SavedQuerySearchRow.js.map +1 -1
- package/build/esm/modules/TutorialRow/TutorialRow.d.ts +1 -1
- package/build/esm/modules/TutorialRow/TutorialRow.js +1 -1
- package/build/esm/modules/TutorialRow/TutorialRow.js.map +1 -1
- package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.d.ts +1 -1
- package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js +2 -1
- package/build/esm/modules/TutorialSearchRow/TutorialSearchRow.js.map +1 -1
- package/build/esm/modules/index.d.ts +2 -0
- package/build/esm/modules/index.js +1 -0
- package/build/esm/modules/index.js.map +1 -1
- package/build/esm/types/queryGraph.d.ts +87 -0
- package/build/esm/types/queryGraph.js +2 -0
- package/build/esm/types/queryGraph.js.map +1 -0
- package/build/esm/widgets/DashboardCharts/DashboardCharts.js +4 -2
- package/build/esm/widgets/DashboardCharts/DashboardCharts.js.map +1 -1
- package/build/esm/widgets/DashboardCharts/types.d.ts +3 -3
- package/build/esm/widgets/DashboardCharts/types.js.map +1 -1
- package/build/esm/widgets/QueriesHistory/QueriesHistory.js +1 -1
- package/build/esm/widgets/QueriesHistory/QueriesHistory.js.map +1 -1
- package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js +3 -2
- package/build/esm/widgets/QueriesHistory/internal/HistoryRowContent.js.map +1 -1
- package/build/esm/widgets/QueriesNavigation/QueriesNavigation.d.ts +1 -1
- package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js +6 -2
- package/build/esm/widgets/QueriesNavigation/QueriesNavigation.js.map +1 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js +1 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createEmptyDetailConfig.js.map +1 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js +4 -1
- package/build/esm/widgets/QueriesNavigation/helpers/createTableDetailConfig.js.map +1 -1
- package/build/esm/widgets/QueryResults/QueryResults.js +1 -1
- package/build/esm/widgets/QueryResults/QueryResults.js.map +1 -1
- package/build/esm/widgets/QueryResults/i18n/index.d.ts +2 -2
- package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js +2 -1
- package/build/esm/widgets/QueryResults/internal/QueryResultsSchema.js.map +1 -1
- package/build/esm/widgets/SavedQueries/SavedQueries.d.ts +2 -2
- package/build/esm/widgets/SavedQueries/SavedQueries.js +1 -1
- package/build/esm/widgets/SavedQueries/SavedQueries.js.map +1 -1
- package/build/esm/widgets/SavedQueries/SavedQueryRowContent.d.ts +2 -2
- package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js +3 -2
- package/build/esm/widgets/SavedQueries/SavedQueryRowContent.js.map +1 -1
- package/build/esm/widgets/TutorialsHistory/TutorialRowContent.d.ts +2 -2
- package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js +3 -2
- package/build/esm/widgets/TutorialsHistory/TutorialRowContent.js.map +1 -1
- package/build/esm/widgets/TutorialsHistory/TutorialsHistory.d.ts +2 -2
- package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js +3 -1
- package/build/esm/widgets/TutorialsHistory/TutorialsHistory.js.map +1 -1
- package/package.json +84 -5
package/README.md
CHANGED
|
@@ -57,6 +57,34 @@ Prefer widgets for product screens. Use modules and components when you need a c
|
|
|
57
57
|
|
|
58
58
|
## Usage
|
|
59
59
|
|
|
60
|
+
### Widget imports
|
|
61
|
+
|
|
62
|
+
All six widgets support both root and individual imports:
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import {SavedQueries} from '@gravity-ui/querieskit';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Alternatively, start directly from the widget's entrypoint:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import {SavedQueries} from '@gravity-ui/querieskit/widgets/SavedQueries';
|
|
72
|
+
import type {SavedQueriesProps} from '@gravity-ui/querieskit/widgets/SavedQueries';
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Individual entrypoints are available for `QueriesHistory`, `SavedQueries`,
|
|
76
|
+
`TutorialsHistory`, `QueriesNavigation`, `QueryResults`, and `DashboardCharts`.
|
|
77
|
+
They expose each widget's existing public exports, including its props and helpers.
|
|
78
|
+
Shared data types remain available from the package root.
|
|
79
|
+
|
|
80
|
+
Individual imports limit the dependency graph the bundler needs to traverse.
|
|
81
|
+
Both forms support tree-shaking with an ESM-aware bundler; individual imports do
|
|
82
|
+
not necessarily produce a smaller bundle. Existing root imports remain supported.
|
|
83
|
+
Keep CSS processing enabled so that the selected widget's styles are included.
|
|
84
|
+
Some bundlers, including esbuild, retain CSS from unused root re-exports even when
|
|
85
|
+
their JavaScript is removed. Individual widget imports avoid introducing those
|
|
86
|
+
unrelated styles.
|
|
87
|
+
|
|
60
88
|
### QueriesHistory
|
|
61
89
|
|
|
62
90
|
Ready-made query history sidebar: search, filters, editable titles, row actions, and optional compare mode.
|
|
@@ -58,6 +58,7 @@ var AttachmentList = exports.AttachmentList = function AttachmentList(_ref) {
|
|
|
58
58
|
className: className,
|
|
59
59
|
width: "100%",
|
|
60
60
|
height: "100%",
|
|
61
|
+
overflow: "auto",
|
|
61
62
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.List, (0, _objectSpread2.default)({
|
|
62
63
|
filterable: false,
|
|
63
64
|
virtualized: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikit","_AttachmentItem","_isInteractiveTarget","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_interopRequireDefault","AttachmentList","exports","_ref","attachments","onEdit","onDelete","onRevert","wasAddedIds","wasEditedIds","editingIds","renderEditForm","className","isDeleted","onItemClick","listProps","_objectWithoutProperties","_excluded","addedIdsSet","useMemo","Set","editedIdsSet","editingIdsSet","handleItemClick","item","index","fromKeyboard","event","id","isInteractiveTarget","target","_jsx","Flex","width","height","children","List","_objectSpread","filterable","virtualized","items","renderItem","attachment","AttachmentItem","wasAdded","wasEdited"],"sources":["AttachmentList.tsx"],"sourcesContent":["import React, {ReactNode, useMemo} from 'react';\nimport {Flex, List, ListProps} from '@gravity-ui/uikit';\nimport {AttachmentItem, AttachmentItemProps} from './internal/AttachmentItem/AttachmentItem';\nimport {isInteractiveTarget} from './helpers/isInteractiveTarget';\nimport './AttachmentList.scss';\n\nexport type AttachmentListProps<\n T extends AttachmentItemProps['attachment'] = AttachmentItemProps['attachment'],\n> = Omit<ListProps<T>, 'items' | 'selectedItemIndex' | 'virtualized'> & {\n attachments: AttachmentItemProps['attachment'][];\n className?: string;\n onDelete?: (attachment: AttachmentItemProps['attachment']) => void;\n onEdit?: (attachment: AttachmentItemProps['attachment']) => void;\n onRevert?: (attachment: AttachmentItemProps['attachment']) => void;\n\n renderEditForm?: (attachment: AttachmentItemProps['attachment']) => ReactNode;\n\n wasAddedIds?: string[];\n wasEditedIds?: string[];\n\n editingIds?: string[];\n\n isDeleted?: boolean;\n};\n\nexport const AttachmentList = ({\n attachments,\n onEdit,\n onDelete,\n onRevert,\n wasAddedIds,\n wasEditedIds,\n editingIds,\n renderEditForm,\n className,\n isDeleted,\n onItemClick,\n ...listProps\n}: AttachmentListProps) => {\n const addedIdsSet = useMemo(() => new Set(wasAddedIds), [wasAddedIds]);\n const editedIdsSet = useMemo(() => new Set(wasEditedIds), [wasEditedIds]);\n const editingIdsSet = useMemo(() => new Set(editingIds), [editingIds]);\n\n const handleItemClick: AttachmentListProps['onItemClick'] = (\n item,\n index,\n fromKeyboard,\n event,\n ) => {\n if (editingIdsSet.has(item.id)) return;\n if (isInteractiveTarget(event?.target)) return;\n onItemClick?.(item, index, fromKeyboard, event);\n };\n\n return (\n <Flex className={className} width=\"100%\" height=\"100%\">\n <List<AttachmentListProps['attachments'][number]>\n filterable={false}\n virtualized={false}\n items={attachments}\n onItemClick={handleItemClick}\n renderItem={(attachment) => {\n if (editingIdsSet.has(attachment.id)) {\n return renderEditForm?.(attachment);\n }\n\n return (\n <AttachmentItem\n attachment={attachment}\n wasAdded={addedIdsSet.has(attachment.id)}\n wasEdited={editedIdsSet.has(attachment.id)}\n onEdit={onEdit}\n onRevert={onRevert}\n onDelete={onDelete}\n isDeleted={isDeleted}\n />\n );\n }}\n {...listProps}\n />\n </Flex>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAA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AGU,IAAI,EAAEC,KAAK,EAAEC,YAAY,EAAEC,KAAK,CAAC;EACnD,CAAC;EAED,oBACI,IAAAI,eAAA,EAACC,WAAI;IAACpB,SAAS,EAAEA,SAAU;IAACqB,KAAK,EAAC,MAAM;IAACC,MAAM,EAAC,MAAM;IAAAC,QAAA,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_uikit","_AttachmentItem","_isInteractiveTarget","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_interopRequireDefault","AttachmentList","exports","_ref","attachments","onEdit","onDelete","onRevert","wasAddedIds","wasEditedIds","editingIds","renderEditForm","className","isDeleted","onItemClick","listProps","_objectWithoutProperties","_excluded","addedIdsSet","useMemo","Set","editedIdsSet","editingIdsSet","handleItemClick","item","index","fromKeyboard","event","id","isInteractiveTarget","target","_jsx","Flex","width","height","overflow","children","List","_objectSpread","filterable","virtualized","items","renderItem","attachment","AttachmentItem","wasAdded","wasEdited"],"sources":["AttachmentList.tsx"],"sourcesContent":["import React, {ReactNode, useMemo} from 'react';\nimport {Flex, List, ListProps} from '@gravity-ui/uikit';\nimport {AttachmentItem, AttachmentItemProps} from './internal/AttachmentItem/AttachmentItem';\nimport {isInteractiveTarget} from './helpers/isInteractiveTarget';\nimport './AttachmentList.scss';\n\nexport type AttachmentListProps<\n T extends AttachmentItemProps['attachment'] = AttachmentItemProps['attachment'],\n> = Omit<ListProps<T>, 'items' | 'selectedItemIndex' | 'virtualized'> & {\n attachments: AttachmentItemProps['attachment'][];\n className?: string;\n onDelete?: (attachment: AttachmentItemProps['attachment']) => void;\n onEdit?: (attachment: AttachmentItemProps['attachment']) => void;\n onRevert?: (attachment: AttachmentItemProps['attachment']) => void;\n\n renderEditForm?: (attachment: AttachmentItemProps['attachment']) => ReactNode;\n\n wasAddedIds?: string[];\n wasEditedIds?: string[];\n\n editingIds?: string[];\n\n isDeleted?: boolean;\n};\n\nexport const AttachmentList = ({\n attachments,\n onEdit,\n onDelete,\n onRevert,\n wasAddedIds,\n wasEditedIds,\n editingIds,\n renderEditForm,\n className,\n isDeleted,\n onItemClick,\n ...listProps\n}: AttachmentListProps) => {\n const addedIdsSet = useMemo(() => new Set(wasAddedIds), [wasAddedIds]);\n const editedIdsSet = useMemo(() => new Set(wasEditedIds), [wasEditedIds]);\n const editingIdsSet = useMemo(() => new Set(editingIds), [editingIds]);\n\n const handleItemClick: AttachmentListProps['onItemClick'] = (\n item,\n index,\n fromKeyboard,\n event,\n ) => {\n if (editingIdsSet.has(item.id)) return;\n if (isInteractiveTarget(event?.target)) return;\n onItemClick?.(item, index, fromKeyboard, event);\n };\n\n return (\n <Flex className={className} width=\"100%\" height=\"100%\" overflow=\"auto\">\n <List<AttachmentListProps['attachments'][number]>\n filterable={false}\n virtualized={false}\n items={attachments}\n onItemClick={handleItemClick}\n renderItem={(attachment) => {\n if (editingIdsSet.has(attachment.id)) {\n return renderEditForm?.(attachment);\n }\n\n return (\n <AttachmentItem\n attachment={attachment}\n wasAdded={addedIdsSet.has(attachment.id)}\n wasEdited={editedIdsSet.has(attachment.id)}\n onEdit={onEdit}\n onRevert={onRevert}\n onDelete={onDelete}\n isDeleted={isDeleted}\n />\n );\n }}\n {...listProps}\n />\n </Flex>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACAA,OAAA;AAA+B,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,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WAAY;MACnBU,WAAW,EAAES,eAAgB;MAC7BmB,UAAU,EAAE,SAAZA,UAAUA,CAAGC,UAAU,EAAK;QACxB,IAAIrB,aAAa,CAAC9B,GAAG,CAACmD,UAAU,CAACf,EAAE,CAAC,EAAE;UAClC,OAAOjB,cAAc,aAAdA,cAAc,uBAAdA,cAAc,CAAGgC,UAAU,CAAC;QACvC;QAEA,oBACI,IAAAZ,eAAA,EAACa,8BAAc;UACXD,UAAU,EAAEA,UAAW;UACvBE,QAAQ,EAAE3B,WAAW,CAAC1B,GAAG,CAACmD,UAAU,CAACf,EAAE,CAAE;UACzCkB,SAAS,EAAEzB,YAAY,CAAC7B,GAAG,CAACmD,UAAU,CAACf,EAAE,CAAE;UAC3CvB,MAAM,EAAEA,MAAO;UACfE,QAAQ,EAAEA,QAAS;UACnBD,QAAQ,EAAEA,QAAS;UACnBO,SAAS,EAAEA;QAAU,CACxB,CAAC;MAEV;IAAE,GACEE,SAAS,CAChB;EAAC,CACA,CAAC;AAEf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.qp-query-graph {
|
|
2
|
+
position: relative;
|
|
3
|
+
min-height: 360px;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
background: var(--g-color-base-background);
|
|
7
|
+
}
|
|
8
|
+
.qp-query-graph__canvas {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
min-height: 360px;
|
|
12
|
+
}
|
|
13
|
+
.qp-query-graph__toolbox {
|
|
14
|
+
position: absolute;
|
|
15
|
+
z-index: 4;
|
|
16
|
+
top: var(--g-spacing-4);
|
|
17
|
+
left: var(--g-spacing-4);
|
|
18
|
+
display: flex;
|
|
19
|
+
width: 28px;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
.qp-query-graph__popup {
|
|
23
|
+
position: absolute;
|
|
24
|
+
z-index: 5;
|
|
25
|
+
width: min(440px, 100% - var(--g-spacing-8));
|
|
26
|
+
max-height: calc(100% - var(--g-spacing-8));
|
|
27
|
+
overflow: auto;
|
|
28
|
+
padding: var(--g-spacing-4);
|
|
29
|
+
border: 1px solid var(--g-color-line-generic);
|
|
30
|
+
border-radius: var(--g-border-radius-l);
|
|
31
|
+
box-shadow: 0 4px 24px var(--g-color-sfx-shadow);
|
|
32
|
+
background: var(--g-color-base-float);
|
|
33
|
+
}
|
|
34
|
+
.qp-query-graph__popup-content, .qp-query-graph__jobs, .qp-query-graph__schemas, .qp-query-graph__details {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: var(--g-spacing-3);
|
|
38
|
+
}
|
|
39
|
+
.qp-query-graph__popup-title {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: var(--g-spacing-2);
|
|
43
|
+
}
|
|
44
|
+
.qp-query-graph__popup-title > div {
|
|
45
|
+
display: flex;
|
|
46
|
+
min-width: 0;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
}
|
|
49
|
+
.qp-query-graph__detail-row {
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
gap: var(--g-spacing-3);
|
|
53
|
+
}
|
|
54
|
+
.qp-query-graph__state {
|
|
55
|
+
height: 100%;
|
|
56
|
+
min-height: 360px;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
padding: var(--g-spacing-6);
|
|
61
|
+
text-align: center;
|
|
62
|
+
}
|
|
63
|
+
.qp-query-graph__large-graph {
|
|
64
|
+
display: flex;
|
|
65
|
+
max-width: 480px;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: var(--g-spacing-4);
|
|
69
|
+
}
|
|
70
|
+
/*# sourceMappingURL=QueryGraph.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["QueryGraph.scss"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,iBAAA;EACA,YAAA;EACA,gBAAA;EACA,0CAAA;AACJ;AACI;EACI,WAAA;EACA,YAAA;EACA,iBAAA;AACR;AAEI;EACI,kBAAA;EACA,UAAA;EACA,uBAAA;EACA,wBAAA;EACA,aAAA;EACA,WAAA;EACA,sBAAA;AAAR;AAGI;EACI,kBAAA;EACA,UAAA;EACA,4CAAA;EACA,2CAAA;EACA,cAAA;EACA,2BAAA;EACA,6CAAA;EACA,uCAAA;EACA,gDAAA;EACA,qCAAA;AADR;AAII;EAII,aAAA;EACA,sBAAA;EACA,uBAAA;AALR;AAQI;EACI,aAAA;EACA,mBAAA;EACA,uBAAA;AANR;AAQQ;EACI,aAAA;EACA,YAAA;EACA,sBAAA;AANZ;AAUI;EACI,aAAA;EACA,8BAAA;EACA,uBAAA;AARR;AAWI;EACI,YAAA;EACA,iBAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,2BAAA;EACA,kBAAA;AATR;AAYI;EACI,aAAA;EACA,gBAAA;EACA,sBAAA;EACA,mBAAA;EACA,uBAAA;AAVR","file":"QueryGraph.css","sourcesContent":[".qp-query-graph {\n position: relative;\n min-height: 360px;\n height: 100%;\n overflow: hidden;\n background: var(--g-color-base-background);\n\n &__canvas {\n width: 100%;\n height: 100%;\n min-height: 360px;\n }\n\n &__toolbox {\n position: absolute;\n z-index: 4;\n top: var(--g-spacing-4);\n left: var(--g-spacing-4);\n display: flex;\n width: 28px;\n flex-direction: column;\n }\n\n &__popup {\n position: absolute;\n z-index: 5;\n width: min(440px, calc(100% - var(--g-spacing-8)));\n max-height: calc(100% - var(--g-spacing-8));\n overflow: auto;\n padding: var(--g-spacing-4);\n border: 1px solid var(--g-color-line-generic);\n border-radius: var(--g-border-radius-l);\n box-shadow: 0 4px 24px var(--g-color-sfx-shadow);\n background: var(--g-color-base-float);\n }\n\n &__popup-content,\n &__jobs,\n &__schemas,\n &__details {\n display: flex;\n flex-direction: column;\n gap: var(--g-spacing-3);\n }\n\n &__popup-title {\n display: flex;\n align-items: center;\n gap: var(--g-spacing-2);\n\n > div {\n display: flex;\n min-width: 0;\n flex-direction: column;\n }\n }\n\n &__detail-row {\n display: flex;\n justify-content: space-between;\n gap: var(--g-spacing-3);\n }\n\n &__state {\n height: 100%;\n min-height: 360px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--g-spacing-6);\n text-align: center;\n }\n\n &__large-graph {\n display: flex;\n max-width: 480px;\n flex-direction: column;\n align-items: center;\n gap: var(--g-spacing-4);\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QueryGraphProps } from '../../types/queryGraph';
|
|
3
|
+
import './QueryGraph.scss';
|
|
4
|
+
export declare function QueryGraph({ nodes, edges, loading, errorContent, className, autoCenter, active, largeGraphThreshold, renderNodePopup, onNodeClick, onError, }: QueryGraphProps): React.JSX.Element;
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.QueryGraph = QueryGraph;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
require("core-js/modules/es.error.cause.js");
|
|
10
|
+
require("core-js/modules/es.error.to-string.js");
|
|
11
|
+
require("core-js/modules/es.array.concat.js");
|
|
12
|
+
require("core-js/modules/es.array.find.js");
|
|
13
|
+
require("core-js/modules/es.array.flat-map.js");
|
|
14
|
+
require("core-js/modules/es.array.join.js");
|
|
15
|
+
require("core-js/modules/es.array.map.js");
|
|
16
|
+
require("core-js/modules/es.array.unscopables.flat-map.js");
|
|
17
|
+
require("core-js/modules/es.function.name.js");
|
|
18
|
+
require("core-js/modules/es.iterator.constructor.js");
|
|
19
|
+
require("core-js/modules/es.iterator.find.js");
|
|
20
|
+
require("core-js/modules/es.iterator.flat-map.js");
|
|
21
|
+
require("core-js/modules/es.iterator.map.js");
|
|
22
|
+
require("core-js/modules/es.object.to-string.js");
|
|
23
|
+
require("core-js/modules/es.string.trim.js");
|
|
24
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
25
|
+
var _graph = require("@gravity-ui/graph");
|
|
26
|
+
var _react2 = require("@gravity-ui/graph/react");
|
|
27
|
+
var _icons = require("@gravity-ui/icons");
|
|
28
|
+
var _uikit = require("@gravity-ui/uikit");
|
|
29
|
+
var _bemCnLite = _interopRequireDefault(require("bem-cn-lite"));
|
|
30
|
+
var _layout = require("./helpers/layout");
|
|
31
|
+
var _i18n = _interopRequireDefault(require("./i18n"));
|
|
32
|
+
var _QueryGraphCanvasBlock = require("./internal/QueryGraphCanvasBlock");
|
|
33
|
+
var _QueryGraphPopup = require("./internal/QueryGraphPopup");
|
|
34
|
+
var _queryGraphIcons = require("./internal/queryGraphIcons");
|
|
35
|
+
var _useQueryGraphLayout2 = require("./internal/useQueryGraphLayout");
|
|
36
|
+
require("./QueryGraph.css");
|
|
37
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
38
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
39
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
40
|
+
var block = (0, _bemCnLite.default)('qp-query-graph');
|
|
41
|
+
var FIT_PADDING = 120;
|
|
42
|
+
var ZOOM_STEP = 0.08;
|
|
43
|
+
var renderEmptyBlock = function renderEmptyBlock() {
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {});
|
|
45
|
+
};
|
|
46
|
+
function QueryGraph(_ref) {
|
|
47
|
+
var nodes = _ref.nodes,
|
|
48
|
+
edges = _ref.edges,
|
|
49
|
+
loading = _ref.loading,
|
|
50
|
+
errorContent = _ref.errorContent,
|
|
51
|
+
className = _ref.className,
|
|
52
|
+
_ref$autoCenter = _ref.autoCenter,
|
|
53
|
+
autoCenter = _ref$autoCenter === void 0 ? true : _ref$autoCenter,
|
|
54
|
+
_ref$active = _ref.active,
|
|
55
|
+
active = _ref$active === void 0 ? true : _ref$active,
|
|
56
|
+
_ref$largeGraphThresh = _ref.largeGraphThreshold,
|
|
57
|
+
largeGraphThreshold = _ref$largeGraphThresh === void 0 ? 250 : _ref$largeGraphThresh,
|
|
58
|
+
renderNodePopup = _ref.renderNodePopup,
|
|
59
|
+
onNodeClick = _ref.onNodeClick,
|
|
60
|
+
onError = _ref.onError;
|
|
61
|
+
var _useState = (0, _react.useState)(false),
|
|
62
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
63
|
+
showLargeGraph = _useState2[0],
|
|
64
|
+
setShowLargeGraph = _useState2[1];
|
|
65
|
+
var nodesRef = (0, _react.useRef)(nodes);
|
|
66
|
+
var edgesRef = (0, _react.useRef)(edges);
|
|
67
|
+
nodesRef.current = nodes;
|
|
68
|
+
edgesRef.current = edges;
|
|
69
|
+
var structureKey = (0, _react.useMemo)(function () {
|
|
70
|
+
return "".concat(nodes.map(function (_ref2) {
|
|
71
|
+
var id = _ref2.id,
|
|
72
|
+
kind = _ref2.kind;
|
|
73
|
+
return "".concat(id, ":").concat(kind);
|
|
74
|
+
}).join('|'), "::").concat(edges.map(function (_ref3) {
|
|
75
|
+
var id = _ref3.id,
|
|
76
|
+
source = _ref3.source,
|
|
77
|
+
target = _ref3.target;
|
|
78
|
+
return "".concat(id, ":").concat(source, ":").concat(target);
|
|
79
|
+
}).join('|'));
|
|
80
|
+
}, [edges, nodes]);
|
|
81
|
+
var validationError = (0, _react.useMemo)(function () {
|
|
82
|
+
try {
|
|
83
|
+
(0, _layout.validateQueryGraph)(nodesRef.current, edgesRef.current);
|
|
84
|
+
return undefined;
|
|
85
|
+
} catch (nextError) {
|
|
86
|
+
return nextError instanceof Error ? nextError : new Error('Unable to build query graph');
|
|
87
|
+
}
|
|
88
|
+
// Only graph structure affects validation.
|
|
89
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
|
+
}, [structureKey]);
|
|
91
|
+
(0, _react.useEffect)(function () {
|
|
92
|
+
if (validationError) onError === null || onError === void 0 || onError(validationError);
|
|
93
|
+
}, [onError, validationError]);
|
|
94
|
+
var shouldConfirm = largeGraphThreshold !== false && nodes.length > largeGraphThreshold;
|
|
95
|
+
if (loading) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
|
|
96
|
+
className: className,
|
|
97
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Loader, {
|
|
98
|
+
size: "m"
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
if (errorContent) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
|
|
102
|
+
className: className,
|
|
103
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
|
|
104
|
+
color: "danger",
|
|
105
|
+
children: errorContent
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
if (validationError) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
|
|
109
|
+
className: className,
|
|
110
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
|
|
111
|
+
color: "danger",
|
|
112
|
+
children: validationError.message
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
if (!nodes.length) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
|
|
116
|
+
className: className,
|
|
117
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
|
|
118
|
+
color: "secondary",
|
|
119
|
+
children: (0, _i18n.default)('context_empty')
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
if (shouldConfirm && !showLargeGraph) {
|
|
123
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
|
|
124
|
+
className: className,
|
|
125
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
126
|
+
className: block('large-graph'),
|
|
127
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
|
|
128
|
+
children: (0, _i18n.default)('context_large-graph', {
|
|
129
|
+
count: nodes.length
|
|
130
|
+
})
|
|
131
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
|
|
132
|
+
view: "action",
|
|
133
|
+
onClick: function onClick() {
|
|
134
|
+
return setShowLargeGraph(true);
|
|
135
|
+
},
|
|
136
|
+
children: (0, _i18n.default)('action_show-graph')
|
|
137
|
+
})]
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(QueryGraphWithLayout, {
|
|
142
|
+
nodes: nodes,
|
|
143
|
+
edges: edges,
|
|
144
|
+
structureKey: structureKey,
|
|
145
|
+
autoCenter: autoCenter,
|
|
146
|
+
active: active,
|
|
147
|
+
renderNodePopup: renderNodePopup,
|
|
148
|
+
onNodeClick: onNodeClick,
|
|
149
|
+
onError: onError,
|
|
150
|
+
className: className
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function QueryGraphWithLayout(_ref4) {
|
|
154
|
+
var nodes = _ref4.nodes,
|
|
155
|
+
edges = _ref4.edges,
|
|
156
|
+
structureKey = _ref4.structureKey,
|
|
157
|
+
autoCenter = _ref4.autoCenter,
|
|
158
|
+
active = _ref4.active,
|
|
159
|
+
renderNodePopup = _ref4.renderNodePopup,
|
|
160
|
+
onNodeClick = _ref4.onNodeClick,
|
|
161
|
+
onError = _ref4.onError,
|
|
162
|
+
className = _ref4.className;
|
|
163
|
+
var _useState3 = (0, _react.useState)(),
|
|
164
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
165
|
+
popup = _useState4[0],
|
|
166
|
+
setPopup = _useState4[1];
|
|
167
|
+
var rootRef = (0, _react.useRef)(null);
|
|
168
|
+
var nodesRef = (0, _react.useRef)(nodes);
|
|
169
|
+
var edgesRef = (0, _react.useRef)(edges);
|
|
170
|
+
nodesRef.current = nodes;
|
|
171
|
+
edgesRef.current = edges;
|
|
172
|
+
var layoutBlocks = (0, _react.useMemo)(function () {
|
|
173
|
+
return nodesRef.current.map(function (node) {
|
|
174
|
+
return (0, _objectSpread2.default)({
|
|
175
|
+
id: node.id
|
|
176
|
+
}, (0, _layout.getQueryGraphNodeSize)(node));
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
// Node status and presentation do not affect layout.
|
|
180
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
181
|
+
[structureKey]);
|
|
182
|
+
var layoutConnections = (0, _react.useMemo)(function () {
|
|
183
|
+
return edgesRef.current.map(function (edge) {
|
|
184
|
+
return {
|
|
185
|
+
id: edge.id,
|
|
186
|
+
sourceBlockId: edge.source,
|
|
187
|
+
targetBlockId: edge.target
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
// Only graph structure affects layout.
|
|
192
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
193
|
+
[structureKey]);
|
|
194
|
+
var _useQueryGraphLayout = (0, _useQueryGraphLayout2.useQueryGraphLayout)({
|
|
195
|
+
structureKey: structureKey,
|
|
196
|
+
blocks: layoutBlocks,
|
|
197
|
+
connections: layoutConnections,
|
|
198
|
+
onError: onError
|
|
199
|
+
}),
|
|
200
|
+
result = _useQueryGraphLayout.result,
|
|
201
|
+
resolvedStructureKey = _useQueryGraphLayout.resolvedStructureKey,
|
|
202
|
+
isInitialLoading = _useQueryGraphLayout.isInitialLoading,
|
|
203
|
+
error = _useQueryGraphLayout.error;
|
|
204
|
+
var graphBlocks = (0, _react.useMemo)(function () {
|
|
205
|
+
return nodes.flatMap(function (node) {
|
|
206
|
+
var position = result === null || result === void 0 ? void 0 : result.blocks[node.id];
|
|
207
|
+
if (!position) return [];
|
|
208
|
+
var _getQueryGraphNodeIco = (0, _queryGraphIcons.getQueryGraphNodeIconSvgs)(node),
|
|
209
|
+
iconSvg = _getQueryGraphNodeIco.iconSvg,
|
|
210
|
+
fallbackIconSvg = _getQueryGraphNodeIco.fallbackIconSvg,
|
|
211
|
+
iconColorToken = _getQueryGraphNodeIco.iconColorToken,
|
|
212
|
+
fallbackIconColorToken = _getQueryGraphNodeIco.fallbackIconColorToken;
|
|
213
|
+
return [(0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
214
|
+
id: node.id,
|
|
215
|
+
is: 'query-node',
|
|
216
|
+
name: node.name,
|
|
217
|
+
selected: false,
|
|
218
|
+
anchors: [],
|
|
219
|
+
meta: {
|
|
220
|
+
node: node,
|
|
221
|
+
iconSvg: iconSvg,
|
|
222
|
+
fallbackIconSvg: fallbackIconSvg,
|
|
223
|
+
iconColorToken: iconColorToken,
|
|
224
|
+
fallbackIconColorToken: fallbackIconColorToken
|
|
225
|
+
}
|
|
226
|
+
}, (0, _layout.getQueryGraphNodeSize)(node)), position)];
|
|
227
|
+
});
|
|
228
|
+
}, [nodes, result]);
|
|
229
|
+
var graphConnections = (0, _react.useMemo)(function () {
|
|
230
|
+
return (0, _layout.createQueryGraphConnections)(edges, result === null || result === void 0 ? void 0 : result.edges);
|
|
231
|
+
}, [edges, result]);
|
|
232
|
+
if (error) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
|
|
233
|
+
className: className,
|
|
234
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Text, {
|
|
235
|
+
color: "danger",
|
|
236
|
+
children: error.message
|
|
237
|
+
})
|
|
238
|
+
});
|
|
239
|
+
if (isInitialLoading || !result || !resolvedStructureKey) return /*#__PURE__*/(0, _jsxRuntime.jsx)(State, {
|
|
240
|
+
className: className,
|
|
241
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Loader, {
|
|
242
|
+
size: "m"
|
|
243
|
+
})
|
|
244
|
+
});
|
|
245
|
+
return (/*#__PURE__*/
|
|
246
|
+
// The renderer is declared below to keep the public component and its states together.
|
|
247
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
248
|
+
(0, _jsxRuntime.jsx)(QueryGraphRenderer, {
|
|
249
|
+
ref: rootRef,
|
|
250
|
+
blocks: graphBlocks,
|
|
251
|
+
connections: graphConnections,
|
|
252
|
+
nodes: nodes,
|
|
253
|
+
structureKey: resolvedStructureKey,
|
|
254
|
+
autoCenter: autoCenter,
|
|
255
|
+
active: active,
|
|
256
|
+
popup: popup,
|
|
257
|
+
setPopup: setPopup,
|
|
258
|
+
renderNodePopup: renderNodePopup,
|
|
259
|
+
onNodeClick: onNodeClick,
|
|
260
|
+
className: className
|
|
261
|
+
})
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
var QueryGraphRenderer = /*#__PURE__*/_react.default.forwardRef(function QueryGraphRendererComponent(_ref5, forwardedRef) {
|
|
265
|
+
var blocks = _ref5.blocks,
|
|
266
|
+
connections = _ref5.connections,
|
|
267
|
+
nodes = _ref5.nodes,
|
|
268
|
+
structureKey = _ref5.structureKey,
|
|
269
|
+
autoCenter = _ref5.autoCenter,
|
|
270
|
+
active = _ref5.active,
|
|
271
|
+
popup = _ref5.popup,
|
|
272
|
+
setPopup = _ref5.setPopup,
|
|
273
|
+
renderNodePopup = _ref5.renderNodePopup,
|
|
274
|
+
onNodeClick = _ref5.onNodeClick,
|
|
275
|
+
className = _ref5.className;
|
|
276
|
+
var rootRef = (0, _react.useRef)(null);
|
|
277
|
+
(0, _react.useImperativeHandle)(forwardedRef, function () {
|
|
278
|
+
return rootRef.current;
|
|
279
|
+
});
|
|
280
|
+
var attachedRef = (0, _react.useRef)(false);
|
|
281
|
+
var centeredRef = (0, _react.useRef)(false);
|
|
282
|
+
var previousActiveRef = (0, _react.useRef)(false);
|
|
283
|
+
var previousStructureRef = (0, _react.useRef)(structureKey);
|
|
284
|
+
var _useState5 = (0, _react.useState)(false),
|
|
285
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
286
|
+
attached = _useState6[0],
|
|
287
|
+
setAttached = _useState6[1];
|
|
288
|
+
var _useState7 = (0, _react.useState)(),
|
|
289
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
290
|
+
hoveredNodeId = _useState8[0],
|
|
291
|
+
setHoveredNodeId = _useState8[1];
|
|
292
|
+
var themeValue = (0, _uikit.useThemeValue)();
|
|
293
|
+
var _useGraph = (0, _react2.useGraph)({
|
|
294
|
+
name: 'query-graph',
|
|
295
|
+
settings: {
|
|
296
|
+
connection: _graph.BezierMultipointConnection,
|
|
297
|
+
canDrag: _graph.ECanDrag.NONE,
|
|
298
|
+
canDragCamera: true,
|
|
299
|
+
canZoomCamera: true,
|
|
300
|
+
canCreateNewConnections: false,
|
|
301
|
+
useBezierConnections: true,
|
|
302
|
+
bezierConnectionDirection: 'horizontal',
|
|
303
|
+
showConnectionArrows: true,
|
|
304
|
+
useBlocksAnchors: false,
|
|
305
|
+
blockComponents: {
|
|
306
|
+
'query-node': _QueryGraphCanvasBlock.QueryGraphCanvasBlock
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}),
|
|
310
|
+
graph = _useGraph.graph,
|
|
311
|
+
api = _useGraph.api,
|
|
312
|
+
setEntities = _useGraph.setEntities,
|
|
313
|
+
start = _useGraph.start,
|
|
314
|
+
stop = _useGraph.stop;
|
|
315
|
+
var _useState9 = (0, _react.useState)(graph.cameraService.getCameraState().scale),
|
|
316
|
+
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
317
|
+
scale = _useState0[0],
|
|
318
|
+
setScale = _useState0[1];
|
|
319
|
+
var _graph$cameraService$ = graph.cameraService.getCameraState(),
|
|
320
|
+
scaleMin = _graph$cameraService$.scaleMin,
|
|
321
|
+
scaleMax = _graph$cameraService$.scaleMax;
|
|
322
|
+
(0, _react2.useGraphEvent)(graph, 'camera-change', function (_ref6) {
|
|
323
|
+
var nextScale = _ref6.scale;
|
|
324
|
+
return setScale(nextScale);
|
|
325
|
+
});
|
|
326
|
+
(0, _react2.useGraphEvent)(graph, 'mouseenter', function (_ref7) {
|
|
327
|
+
var _state$meta;
|
|
328
|
+
var target = _ref7.target;
|
|
329
|
+
var state = target === null || target === void 0 ? void 0 : target.state;
|
|
330
|
+
if (state !== null && state !== void 0 && (_state$meta = state.meta) !== null && _state$meta !== void 0 && _state$meta.node) setHoveredNodeId(state.meta.node.id);
|
|
331
|
+
});
|
|
332
|
+
(0, _react2.useGraphEvent)(graph, 'mouseleave', function (_ref8) {
|
|
333
|
+
var _state$meta2;
|
|
334
|
+
var target = _ref8.target;
|
|
335
|
+
var state = target === null || target === void 0 ? void 0 : target.state;
|
|
336
|
+
if (state !== null && state !== void 0 && (_state$meta2 = state.meta) !== null && _state$meta2 !== void 0 && _state$meta2.node) setHoveredNodeId(undefined);
|
|
337
|
+
});
|
|
338
|
+
(0, _react.useEffect)(function () {
|
|
339
|
+
if (!rootRef.current) return;
|
|
340
|
+
var background = getComputedStyle(rootRef.current).getPropertyValue('--g-color-base-background').trim();
|
|
341
|
+
var connection = getComputedStyle(rootRef.current).getPropertyValue('--g-color-line-generic-accent').trim();
|
|
342
|
+
if (!background || !connection) return;
|
|
343
|
+
var colors = api.getGraphColors();
|
|
344
|
+
api.updateGraphColors((0, _objectSpread2.default)((0, _objectSpread2.default)({}, colors), {}, {
|
|
345
|
+
canvas: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, colors.canvas), {}, {
|
|
346
|
+
belowLayerBackground: background,
|
|
347
|
+
layerBackground: background,
|
|
348
|
+
border: background,
|
|
349
|
+
dots: background
|
|
350
|
+
}),
|
|
351
|
+
connection: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, colors.connection), {}, {
|
|
352
|
+
background: connection
|
|
353
|
+
})
|
|
354
|
+
}));
|
|
355
|
+
}, [api, themeValue]);
|
|
356
|
+
var visibleConnections = (0, _react.useMemo)(function () {
|
|
357
|
+
return connections.map(function (connection) {
|
|
358
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, connection), {}, {
|
|
359
|
+
selected: Boolean(hoveredNodeId && (connection.sourceBlockId === hoveredNodeId || connection.targetBlockId === hoveredNodeId))
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
}, [connections, hoveredNodeId]);
|
|
363
|
+
(0, _react.useEffect)(function () {
|
|
364
|
+
return setEntities({
|
|
365
|
+
blocks: blocks,
|
|
366
|
+
connections: visibleConnections
|
|
367
|
+
});
|
|
368
|
+
}, [blocks, setEntities, visibleConnections]);
|
|
369
|
+
(0, _react.useEffect)(function () {
|
|
370
|
+
if (!attachedRef.current) return;
|
|
371
|
+
if (active) start();else stop();
|
|
372
|
+
}, [active, start, stop]);
|
|
373
|
+
(0, _react.useEffect)(function () {
|
|
374
|
+
var changed = previousStructureRef.current !== structureKey;
|
|
375
|
+
var becameActive = active && !previousActiveRef.current;
|
|
376
|
+
var frame;
|
|
377
|
+
if (attached && active && (!centeredRef.current || becameActive || autoCenter && changed)) {
|
|
378
|
+
frame = requestAnimationFrame(function () {
|
|
379
|
+
api.zoomToViewPort({
|
|
380
|
+
padding: FIT_PADDING
|
|
381
|
+
});
|
|
382
|
+
centeredRef.current = true;
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
previousActiveRef.current = Boolean(active);
|
|
386
|
+
previousStructureRef.current = structureKey;
|
|
387
|
+
setPopup(undefined);
|
|
388
|
+
return function () {
|
|
389
|
+
if (frame !== undefined) cancelAnimationFrame(frame);
|
|
390
|
+
};
|
|
391
|
+
}, [active, api, attached, autoCenter, setPopup, structureKey]);
|
|
392
|
+
var handleClick = function handleClick(_ref9) {
|
|
393
|
+
var _state$meta3;
|
|
394
|
+
var target = _ref9.target,
|
|
395
|
+
sourceEvent = _ref9.sourceEvent;
|
|
396
|
+
var state = target === null || target === void 0 ? void 0 : target.state;
|
|
397
|
+
if (!(state !== null && state !== void 0 && (_state$meta3 = state.meta) !== null && _state$meta3 !== void 0 && _state$meta3.node) || !rootRef.current) {
|
|
398
|
+
setPopup(undefined);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
var mouseEvent = sourceEvent;
|
|
402
|
+
var rect = rootRef.current.getBoundingClientRect();
|
|
403
|
+
var left = Math.min(Math.max(16, mouseEvent.clientX - rect.left + 12), rect.width - 456);
|
|
404
|
+
var top = Math.min(Math.max(16, mouseEvent.clientY - rect.top + 12), rect.height - 240);
|
|
405
|
+
setPopup({
|
|
406
|
+
nodeId: state.meta.node.id,
|
|
407
|
+
left: Math.max(16, left),
|
|
408
|
+
top: Math.max(16, top)
|
|
409
|
+
});
|
|
410
|
+
onNodeClick === null || onNodeClick === void 0 || onNodeClick(state.meta.node, mouseEvent);
|
|
411
|
+
};
|
|
412
|
+
var selectedNode = popup ? nodes.find(function (node) {
|
|
413
|
+
return node.id === popup.nodeId;
|
|
414
|
+
}) : undefined;
|
|
415
|
+
var defaultContent = selectedNode ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryGraphPopup.QueryGraphPopup, {
|
|
416
|
+
node: selectedNode
|
|
417
|
+
}) : null;
|
|
418
|
+
var popupContent = null;
|
|
419
|
+
if (selectedNode) {
|
|
420
|
+
popupContent = renderNodePopup ? renderNodePopup({
|
|
421
|
+
node: selectedNode,
|
|
422
|
+
defaultContent: defaultContent
|
|
423
|
+
}) : defaultContent;
|
|
424
|
+
}
|
|
425
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
426
|
+
ref: rootRef,
|
|
427
|
+
className: block(null, className),
|
|
428
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.GraphCanvas, {
|
|
429
|
+
graph: graph,
|
|
430
|
+
className: block('canvas'),
|
|
431
|
+
click: handleClick,
|
|
432
|
+
renderBlock: renderEmptyBlock,
|
|
433
|
+
onStateChanged: function onStateChanged(_ref0) {
|
|
434
|
+
var state = _ref0.state;
|
|
435
|
+
if (state === _graph.GraphState.ATTACHED) {
|
|
436
|
+
if (active) start();
|
|
437
|
+
attachedRef.current = true;
|
|
438
|
+
setAttached(true);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
442
|
+
className: block('toolbox'),
|
|
443
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Tooltip, {
|
|
444
|
+
content: (0, _i18n.default)('action_zoom-in'),
|
|
445
|
+
placement: "right",
|
|
446
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
|
|
447
|
+
view: "raised",
|
|
448
|
+
pin: "round-brick",
|
|
449
|
+
"aria-label": (0, _i18n.default)('action_zoom-in'),
|
|
450
|
+
disabled: scale >= scaleMax,
|
|
451
|
+
onClick: function onClick() {
|
|
452
|
+
return changeZoom(graph, ZOOM_STEP);
|
|
453
|
+
},
|
|
454
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Icon, {
|
|
455
|
+
data: _icons.MagnifierPlus
|
|
456
|
+
})
|
|
457
|
+
})
|
|
458
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Tooltip, {
|
|
459
|
+
content: (0, _i18n.default)('action_fit'),
|
|
460
|
+
placement: "right",
|
|
461
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
|
|
462
|
+
view: "raised",
|
|
463
|
+
pin: "brick-brick",
|
|
464
|
+
"aria-label": (0, _i18n.default)('action_fit'),
|
|
465
|
+
onClick: function onClick() {
|
|
466
|
+
return api.zoomToViewPort({
|
|
467
|
+
padding: FIT_PADDING
|
|
468
|
+
});
|
|
469
|
+
},
|
|
470
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Icon, {
|
|
471
|
+
data: _icons.SquareDashed
|
|
472
|
+
})
|
|
473
|
+
})
|
|
474
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Tooltip, {
|
|
475
|
+
content: (0, _i18n.default)('action_zoom-out'),
|
|
476
|
+
placement: "right",
|
|
477
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Button, {
|
|
478
|
+
view: "raised",
|
|
479
|
+
pin: "brick-round",
|
|
480
|
+
"aria-label": (0, _i18n.default)('action_zoom-out'),
|
|
481
|
+
disabled: scale <= scaleMin,
|
|
482
|
+
onClick: function onClick() {
|
|
483
|
+
return changeZoom(graph, -ZOOM_STEP);
|
|
484
|
+
},
|
|
485
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_uikit.Icon, {
|
|
486
|
+
data: _icons.MagnifierMinus
|
|
487
|
+
})
|
|
488
|
+
})
|
|
489
|
+
})]
|
|
490
|
+
}), popup && popupContent !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
491
|
+
className: block('popup'),
|
|
492
|
+
style: {
|
|
493
|
+
left: popup.left,
|
|
494
|
+
top: popup.top
|
|
495
|
+
},
|
|
496
|
+
children: popupContent
|
|
497
|
+
})]
|
|
498
|
+
});
|
|
499
|
+
});
|
|
500
|
+
function changeZoom(graph, delta) {
|
|
501
|
+
var camera = graph.cameraService;
|
|
502
|
+
var state = camera.getCameraState();
|
|
503
|
+
var nextScale = Math.min(state.scaleMax, Math.max(state.scaleMin, state.scale + delta));
|
|
504
|
+
camera.zoom(state.width / 2, state.height / 2, nextScale);
|
|
505
|
+
}
|
|
506
|
+
function State(_ref1) {
|
|
507
|
+
var className = _ref1.className,
|
|
508
|
+
children = _ref1.children;
|
|
509
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
510
|
+
className: block(null, className),
|
|
511
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
512
|
+
className: block('state'),
|
|
513
|
+
children: children
|
|
514
|
+
})
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
// #sourceMappingURL=QueryGraph.js.map
|