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