@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
|
@@ -2,12 +2,12 @@ import React, {useState} from 'react';
|
|
|
2
2
|
import type {Meta, StoryObj} from '@storybook/react';
|
|
3
3
|
import {QueriesHistory} from './QueriesHistory';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from '../../types/history';
|
|
5
|
+
QueryListFieldKey,
|
|
6
|
+
QueryListFilterConfig,
|
|
7
|
+
QueryListItem,
|
|
8
|
+
QueryListVisibleFieldsConfig,
|
|
9
|
+
} from '../../types/queryList';
|
|
10
|
+
import {QueryHistoryRow} from '../../types/history';
|
|
11
11
|
import {action} from 'storybook/actions';
|
|
12
12
|
|
|
13
13
|
const now = Date.now();
|
|
@@ -20,7 +20,7 @@ SELECT
|
|
|
20
20
|
"test_task" AS task_id,
|
|
21
21
|
SUBSTRING("test", 1, 1) AS truncated_char`;
|
|
22
22
|
|
|
23
|
-
const BASE_ITEMS:
|
|
23
|
+
const BASE_ITEMS: QueryListItem<QueryHistoryRow>[] = [
|
|
24
24
|
{header: 'Today', height: 28},
|
|
25
25
|
{
|
|
26
26
|
id: 1,
|
|
@@ -78,8 +78,8 @@ const BASE_ITEMS: QueryHistoryItem<QueryHistoryRow>[] = [
|
|
|
78
78
|
},
|
|
79
79
|
];
|
|
80
80
|
|
|
81
|
-
type VisibleFields =
|
|
82
|
-
const activeFields:
|
|
81
|
+
type VisibleFields = QueryListVisibleFieldsConfig<QueryHistoryRow>['fields'];
|
|
82
|
+
const activeFields: QueryListFieldKey<QueryHistoryRow>[] = [
|
|
83
83
|
'duration',
|
|
84
84
|
'mode',
|
|
85
85
|
'startTime',
|
|
@@ -109,7 +109,7 @@ const fields: VisibleFields = [
|
|
|
109
109
|
},
|
|
110
110
|
];
|
|
111
111
|
|
|
112
|
-
const filterFields:
|
|
112
|
+
const filterFields: QueryListFilterConfig['fields'] = [
|
|
113
113
|
{id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},
|
|
114
114
|
{id: 'range', type: 'rangeDatePicker', title: 'Period'},
|
|
115
115
|
{
|
|
@@ -143,7 +143,7 @@ const DefaultStory = () => {
|
|
|
143
143
|
const [items, setItems] = useState([...BASE_ITEMS]);
|
|
144
144
|
const [search, setSearch] = useState({value: '', fullSearch: false});
|
|
145
145
|
const [visibleFields, setVisibleFields] =
|
|
146
|
-
useState<
|
|
146
|
+
useState<QueryListFieldKey<QueryHistoryRow>[]>(activeFields);
|
|
147
147
|
const [compareMode, setCompareMode] = useState(false);
|
|
148
148
|
const [comparedRows, setComparedRows] = useState<number[]>([]);
|
|
149
149
|
const [editingId, setEditingId] = useState<number | undefined>(undefined);
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import cn from 'bem-cn-lite';
|
|
3
|
+
import {QueriesList} from '../../modules';
|
|
3
4
|
import i18n from './i18n';
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from '../../types/history';
|
|
15
|
-
import {
|
|
16
|
-
import {getListKey} from '../../helpers/getListKey';
|
|
17
|
-
import {ComparisonActions} from './ComparisonActions';
|
|
18
|
-
import cn from 'bem-cn-lite';
|
|
6
|
+
QueryListComparisonConfig,
|
|
7
|
+
QueryListEditingConfig,
|
|
8
|
+
QueryListFilterConfig,
|
|
9
|
+
QueryListItem,
|
|
10
|
+
QueryListRowAction,
|
|
11
|
+
QueryListRowRenderData,
|
|
12
|
+
QueryListSearchConfig,
|
|
13
|
+
QueryListVisibleFieldsConfig,
|
|
14
|
+
} from '../../types/queryList';
|
|
15
|
+
import {QueryHistoryRow} from '../../types/history';
|
|
16
|
+
import {HistoryRowContent} from './internal/HistoryRowContent';
|
|
19
17
|
import './QueriesHistory.scss';
|
|
20
18
|
|
|
21
19
|
export type QueriesHistoryProps<T extends QueryHistoryRow = QueryHistoryRow> = {
|
|
22
20
|
className?: string;
|
|
23
21
|
title?: string;
|
|
24
22
|
logo?: React.ReactNode;
|
|
25
|
-
search:
|
|
26
|
-
filter?:
|
|
27
|
-
items:
|
|
23
|
+
search: QueryListSearchConfig;
|
|
24
|
+
filter?: QueryListFilterConfig;
|
|
25
|
+
items: QueryListItem<T>[];
|
|
28
26
|
selectedRowId?: T['id'];
|
|
29
|
-
editing?:
|
|
30
|
-
comparison?:
|
|
31
|
-
visibleFields?:
|
|
32
|
-
renderRowItem?: (data:
|
|
33
|
-
getRowActions?: (item: T) =>
|
|
34
|
-
onListItemClick?: (item:
|
|
27
|
+
editing?: QueryListEditingConfig<T>;
|
|
28
|
+
comparison?: QueryListComparisonConfig<T>;
|
|
29
|
+
visibleFields?: QueryListVisibleFieldsConfig<T>;
|
|
30
|
+
renderRowItem?: (data: QueryListRowRenderData<T>) => React.ReactNode;
|
|
31
|
+
getRowActions?: (item: T) => QueryListRowAction<T>[];
|
|
32
|
+
onListItemClick?: (item: QueryListItem<T>) => void;
|
|
35
33
|
};
|
|
36
34
|
|
|
37
35
|
const block = cn('qp-query-history');
|
|
@@ -51,47 +49,23 @@ export const QueriesHistory = <T extends QueryHistoryRow>({
|
|
|
51
49
|
onListItemClick,
|
|
52
50
|
className,
|
|
53
51
|
}: QueriesHistoryProps<T>) => {
|
|
54
|
-
const showSearchResults = Boolean(search.fullSearch && search.value?.trim());
|
|
55
|
-
const rowVariant = showSearchResults ? 'search' : 'default';
|
|
56
|
-
|
|
57
52
|
return (
|
|
58
|
-
<
|
|
53
|
+
<QueriesList
|
|
59
54
|
className={block(null, className)}
|
|
60
55
|
title={title || i18n('title_history')}
|
|
61
56
|
logo={logo}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
/>
|
|
72
|
-
}
|
|
73
|
-
footer={
|
|
74
|
-
comparison && (
|
|
75
|
-
<ComparisonActions
|
|
76
|
-
comparison={comparison}
|
|
77
|
-
className={block('comparison-actions')}
|
|
78
|
-
/>
|
|
79
|
-
)
|
|
57
|
+
search={search}
|
|
58
|
+
filter={filter}
|
|
59
|
+
items={items}
|
|
60
|
+
selectedRowId={selectedRowId}
|
|
61
|
+
visibleFields={visibleFields}
|
|
62
|
+
editing={editing}
|
|
63
|
+
comparison={comparison}
|
|
64
|
+
getRowActions={getRowActions}
|
|
65
|
+
renderRow={(data) =>
|
|
66
|
+
renderRowItem ? renderRowItem(data) : <HistoryRowContent {...data} />
|
|
80
67
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
key={getListKey(items, rowVariant)}
|
|
84
|
-
items={items}
|
|
85
|
-
rowVariant={rowVariant}
|
|
86
|
-
selectedRowId={selectedRowId}
|
|
87
|
-
visibleFields={visibleFields}
|
|
88
|
-
editing={editing}
|
|
89
|
-
comparison={comparison}
|
|
90
|
-
renderRowItem={renderRowItem}
|
|
91
|
-
getRowActions={getRowActions}
|
|
92
|
-
showFiltersHint={Boolean(filter)}
|
|
93
|
-
onItemClick={onListItemClick}
|
|
94
|
-
/>
|
|
95
|
-
</HistoryLayout>
|
|
68
|
+
onListItemClick={onListItemClick}
|
|
69
|
+
/>
|
|
96
70
|
);
|
|
97
71
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import {HistoryGroupHeader} from '../../../components';
|
|
3
|
+
import {HistoryRow, HistorySearchRow} from '../../../modules';
|
|
4
|
+
import {QueryListRowRenderData} from '../../../types/queryList';
|
|
5
|
+
import {QueryHistoryRow} from '../../../types/history';
|
|
6
6
|
|
|
7
7
|
export const HistoryRowContent = <T extends QueryHistoryRow>({
|
|
8
8
|
variant,
|
|
9
9
|
...data
|
|
10
|
-
}:
|
|
10
|
+
}: QueryListRowRenderData<T>) => {
|
|
11
11
|
const {item} = data;
|
|
12
12
|
|
|
13
13
|
if ('header' in item) {
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import React, {useMemo, useState} from 'react';
|
|
2
|
+
import type {Meta, StoryObj} from '@storybook/react';
|
|
3
|
+
import {Text} from '@gravity-ui/uikit';
|
|
4
|
+
import {action} from 'storybook/actions';
|
|
5
|
+
import {
|
|
6
|
+
QueryListFieldKey,
|
|
7
|
+
QueryListFilterConfig,
|
|
8
|
+
QueryListItem,
|
|
9
|
+
QueryListVisibleFieldsConfig,
|
|
10
|
+
} from '../../types/queryList';
|
|
11
|
+
import {SavedQuery} from '../../types/savedQueries';
|
|
12
|
+
import {SavedQueries} from './SavedQueries';
|
|
13
|
+
|
|
14
|
+
const QUERY = `SELECT
|
|
15
|
+
session_id,
|
|
16
|
+
COUNT(*) AS sessions_count
|
|
17
|
+
FROM visits
|
|
18
|
+
GROUP BY session_id;`;
|
|
19
|
+
|
|
20
|
+
const BASE_ITEMS: QueryListItem<SavedQuery>[] = [
|
|
21
|
+
{
|
|
22
|
+
id: 1,
|
|
23
|
+
title: 'New Query',
|
|
24
|
+
savedAt: '2026-04-29T12:00:00.000Z',
|
|
25
|
+
engine: 'SQL',
|
|
26
|
+
author: 'Anna Petrova',
|
|
27
|
+
query: QUERY,
|
|
28
|
+
height: 52,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 2,
|
|
32
|
+
title: 'Daily conversion report',
|
|
33
|
+
savedAt: '2026-04-29T11:00:00.000Z',
|
|
34
|
+
engine: 'YQL',
|
|
35
|
+
author: 'Pavel Sidorov',
|
|
36
|
+
query: QUERY,
|
|
37
|
+
height: 52,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 3,
|
|
41
|
+
title: 'Product funnel',
|
|
42
|
+
savedAt: '2026-04-28T09:00:00.000Z',
|
|
43
|
+
engine: 'SQL',
|
|
44
|
+
author: 'Maria Volkova',
|
|
45
|
+
query: 'SELECT 1;',
|
|
46
|
+
height: 52,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const filterFields: QueryListFilterConfig['fields'] = [
|
|
51
|
+
{id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},
|
|
52
|
+
{id: 'range', type: 'rangeDatePicker', title: 'Period'},
|
|
53
|
+
{
|
|
54
|
+
id: 'engine',
|
|
55
|
+
type: 'checkboxGroup',
|
|
56
|
+
title: 'Engine',
|
|
57
|
+
initialValue: [],
|
|
58
|
+
items: [
|
|
59
|
+
{id: 'yql', title: 'YQL'},
|
|
60
|
+
{id: 'sql', title: 'SQL'},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const fields: QueryListVisibleFieldsConfig<SavedQuery>['fields'] = [
|
|
66
|
+
{id: 'savedAt', title: 'Saved date'},
|
|
67
|
+
{id: 'engine', title: 'Engine'},
|
|
68
|
+
{id: 'author', title: 'Author'},
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const meta: Meta<typeof SavedQueries> = {
|
|
72
|
+
title: 'Widgets/SavedQueries',
|
|
73
|
+
component: SavedQueries,
|
|
74
|
+
tags: ['autodocs'],
|
|
75
|
+
parameters: {layout: 'padded'},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default meta;
|
|
79
|
+
type Story = StoryObj<typeof SavedQueries>;
|
|
80
|
+
|
|
81
|
+
const SavedQueriesStory = () => {
|
|
82
|
+
const [items, setItems] = useState(BASE_ITEMS);
|
|
83
|
+
const [search, setSearch] = useState({value: '', fullSearch: false});
|
|
84
|
+
const [visibleFields, setVisibleFields] = useState<QueryListFieldKey<SavedQuery>[]>([
|
|
85
|
+
'savedAt',
|
|
86
|
+
'engine',
|
|
87
|
+
'author',
|
|
88
|
+
]);
|
|
89
|
+
const [comparedRowIds, setComparedRowIds] = useState<number[]>([]);
|
|
90
|
+
const [editingRowId, setEditingRowId] = useState<number>();
|
|
91
|
+
|
|
92
|
+
const filteredItems = useMemo(() => {
|
|
93
|
+
if (!search.value) return items;
|
|
94
|
+
|
|
95
|
+
const value = search.value.toLowerCase();
|
|
96
|
+
return items.filter((item) => {
|
|
97
|
+
if ('header' in item) return false;
|
|
98
|
+
|
|
99
|
+
return search.fullSearch
|
|
100
|
+
? item.title.toLowerCase().includes(value) ||
|
|
101
|
+
item.query?.toLowerCase().includes(value)
|
|
102
|
+
: item.title.toLowerCase().includes(value);
|
|
103
|
+
});
|
|
104
|
+
}, [items, search]);
|
|
105
|
+
|
|
106
|
+
const updateTitle = (item: SavedQuery, title: string) => {
|
|
107
|
+
setItems((currentItems) =>
|
|
108
|
+
currentItems.map((currentItem) =>
|
|
109
|
+
'id' in currentItem && currentItem.id === item.id
|
|
110
|
+
? {...currentItem, title}
|
|
111
|
+
: currentItem,
|
|
112
|
+
),
|
|
113
|
+
);
|
|
114
|
+
setEditingRowId(undefined);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div style={{width: 360, height: 560}}>
|
|
119
|
+
<SavedQueries
|
|
120
|
+
items={filteredItems}
|
|
121
|
+
search={{...search, hasClear: true, onUpdate: setSearch}}
|
|
122
|
+
filter={{
|
|
123
|
+
fields: filterFields,
|
|
124
|
+
onApply: action('onFilterApply'),
|
|
125
|
+
onReset: action('onFilterReset'),
|
|
126
|
+
}}
|
|
127
|
+
visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}
|
|
128
|
+
editing={{
|
|
129
|
+
rowId: editingRowId,
|
|
130
|
+
onSubmit: updateTitle,
|
|
131
|
+
onCancel: () => setEditingRowId(undefined),
|
|
132
|
+
}}
|
|
133
|
+
comparison={{
|
|
134
|
+
enabled: Boolean(comparedRowIds.length),
|
|
135
|
+
comparedRowIds,
|
|
136
|
+
onChange: (item, selected) => {
|
|
137
|
+
setComparedRowIds((currentIds) =>
|
|
138
|
+
selected
|
|
139
|
+
? [...currentIds.filter((id) => id !== item.id).slice(-1), item.id]
|
|
140
|
+
: currentIds.filter((id) => id !== item.id),
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
onCancel: () => setComparedRowIds([]),
|
|
144
|
+
onCompare: () => action('onCompare')(comparedRowIds),
|
|
145
|
+
}}
|
|
146
|
+
getRowActions={(item) => [
|
|
147
|
+
{text: 'Copy to', onClick: () => action('onCopyTo')(item)},
|
|
148
|
+
{text: 'Show operations', onClick: () => action('onShowOperations')(item)},
|
|
149
|
+
{text: 'Edit', onClick: () => setEditingRowId(item.id)},
|
|
150
|
+
{
|
|
151
|
+
text: 'Compare with baseline',
|
|
152
|
+
onClick: () => setComparedRowIds([item.id]),
|
|
153
|
+
},
|
|
154
|
+
{text: 'Delete', theme: 'danger', onClick: () => action('onDelete')(item)},
|
|
155
|
+
]}
|
|
156
|
+
/>
|
|
157
|
+
</div>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
type ExtendedSavedQuery = SavedQuery & {team: string};
|
|
162
|
+
|
|
163
|
+
const CustomAuthorStory = () => {
|
|
164
|
+
const items: QueryListItem<ExtendedSavedQuery>[] = BASE_ITEMS.map((item) =>
|
|
165
|
+
'header' in item ? item : {...item, team: 'Analytics'},
|
|
166
|
+
);
|
|
167
|
+
const [search, setSearch] = useState({value: '', fullSearch: false});
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
<div style={{width: 360, height: 280}}>
|
|
171
|
+
<SavedQueries
|
|
172
|
+
items={items}
|
|
173
|
+
search={{...search, hasClear: true, onUpdate: setSearch}}
|
|
174
|
+
renderAuthor={(item) => <Text color="complementary">{item.team}</Text>}
|
|
175
|
+
/>
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const EmptyStory = () => {
|
|
181
|
+
const [search, setSearch] = useState({value: '', fullSearch: false});
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<div style={{width: 360, height: 280}}>
|
|
185
|
+
<SavedQueries items={[]} search={{...search, hasClear: true, onUpdate: setSearch}} />
|
|
186
|
+
</div>
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const Default: Story = {render: () => <SavedQueriesStory />};
|
|
191
|
+
export const CustomAuthor: Story = {render: () => <CustomAuthorStory />};
|
|
192
|
+
export const Empty: Story = {render: () => <EmptyStory />};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'bem-cn-lite';
|
|
3
|
+
import {QueriesList} from '../../modules';
|
|
4
|
+
import {
|
|
5
|
+
QueryListComparisonConfig,
|
|
6
|
+
QueryListEditingConfig,
|
|
7
|
+
QueryListFilterConfig,
|
|
8
|
+
QueryListItem,
|
|
9
|
+
QueryListRowAction,
|
|
10
|
+
QueryListRowRenderData,
|
|
11
|
+
QueryListSearchConfig,
|
|
12
|
+
QueryListVisibleFieldsConfig,
|
|
13
|
+
} from '../../types/queryList';
|
|
14
|
+
import {SavedQuery} from '../../types/savedQueries';
|
|
15
|
+
import i18n from './i18n';
|
|
16
|
+
import {SavedQueryRowContent} from './SavedQueryRowContent';
|
|
17
|
+
import './SavedQueries.scss';
|
|
18
|
+
|
|
19
|
+
export type SavedQueriesProps<T extends SavedQuery = SavedQuery> = {
|
|
20
|
+
className?: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
logo?: React.ReactNode;
|
|
23
|
+
search: QueryListSearchConfig;
|
|
24
|
+
filter?: QueryListFilterConfig;
|
|
25
|
+
items: QueryListItem<T>[];
|
|
26
|
+
selectedRowId?: T['id'];
|
|
27
|
+
editing?: QueryListEditingConfig<T>;
|
|
28
|
+
comparison?: QueryListComparisonConfig<T>;
|
|
29
|
+
visibleFields?: QueryListVisibleFieldsConfig<T>;
|
|
30
|
+
renderAuthor?: (item: T) => React.ReactNode;
|
|
31
|
+
renderRowItem?: (data: QueryListRowRenderData<T>) => React.ReactNode;
|
|
32
|
+
getRowActions?: (item: T) => QueryListRowAction<T>[];
|
|
33
|
+
onListItemClick?: (item: QueryListItem<T>) => void;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const block = cn('qp-saved-queries');
|
|
37
|
+
|
|
38
|
+
export const SavedQueries = <T extends SavedQuery>({
|
|
39
|
+
title,
|
|
40
|
+
logo,
|
|
41
|
+
search,
|
|
42
|
+
filter,
|
|
43
|
+
items,
|
|
44
|
+
selectedRowId,
|
|
45
|
+
editing,
|
|
46
|
+
comparison,
|
|
47
|
+
visibleFields,
|
|
48
|
+
renderAuthor,
|
|
49
|
+
renderRowItem,
|
|
50
|
+
getRowActions,
|
|
51
|
+
onListItemClick,
|
|
52
|
+
className,
|
|
53
|
+
}: SavedQueriesProps<T>) => {
|
|
54
|
+
return (
|
|
55
|
+
<QueriesList
|
|
56
|
+
className={block(null, className)}
|
|
57
|
+
title={title || i18n('title_saved')}
|
|
58
|
+
logo={logo}
|
|
59
|
+
search={search}
|
|
60
|
+
filter={filter}
|
|
61
|
+
items={items}
|
|
62
|
+
selectedRowId={selectedRowId}
|
|
63
|
+
visibleFields={visibleFields}
|
|
64
|
+
editing={editing}
|
|
65
|
+
comparison={comparison}
|
|
66
|
+
getRowActions={getRowActions}
|
|
67
|
+
renderRow={(data) =>
|
|
68
|
+
renderRowItem ? (
|
|
69
|
+
renderRowItem(data)
|
|
70
|
+
) : (
|
|
71
|
+
<SavedQueryRowContent {...data} renderAuthor={renderAuthor} />
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
onListItemClick={onListItemClick}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {HistoryGroupHeader} from '../../components';
|
|
3
|
+
import {SavedQueryRow, SavedQuerySearchRow} from '../../modules';
|
|
4
|
+
import {QueryListRowRenderData} from '../../types/queryList';
|
|
5
|
+
import {SavedQuery} from '../../types/savedQueries';
|
|
6
|
+
|
|
7
|
+
type Props<T extends SavedQuery> = QueryListRowRenderData<T> & {
|
|
8
|
+
renderAuthor?: (item: T) => React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const SavedQueryRowContent = <T extends SavedQuery>({
|
|
12
|
+
item,
|
|
13
|
+
variant,
|
|
14
|
+
renderAuthor,
|
|
15
|
+
...data
|
|
16
|
+
}: Props<T>) => {
|
|
17
|
+
if ('header' in item) {
|
|
18
|
+
return <HistoryGroupHeader title={item.header} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return variant === 'search' ? (
|
|
22
|
+
<SavedQuerySearchRow {...data} item={item} renderAuthor={renderAuthor} />
|
|
23
|
+
) : (
|
|
24
|
+
<SavedQueryRow {...data} item={item} renderAuthor={renderAuthor} />
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {QueryListRowRenderData} from '../../types/queryList';
|
|
3
3
|
import {TutorialHistoryRow} from '../../types/tutorial';
|
|
4
4
|
import {HistoryGroupHeader} from '../../components';
|
|
5
5
|
import {TutorialRow, TutorialSearchRow} from '../../modules';
|
|
@@ -7,7 +7,7 @@ import {TutorialRow, TutorialSearchRow} from '../../modules';
|
|
|
7
7
|
export const TutorialRowContent = <T extends TutorialHistoryRow>({
|
|
8
8
|
item,
|
|
9
9
|
variant,
|
|
10
|
-
}:
|
|
10
|
+
}: QueryListRowRenderData<T>) => {
|
|
11
11
|
if ('header' in item) {
|
|
12
12
|
return <HistoryGroupHeader title={item.header} />;
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, {useState} from 'react';
|
|
2
2
|
import type {Meta, StoryObj} from '@storybook/react';
|
|
3
3
|
import {TutorialsHistory} from './TutorialsHistory';
|
|
4
|
-
import {
|
|
4
|
+
import {QueryListFilterConfig, QueryListItem} from '../../types/queryList';
|
|
5
5
|
import {TutorialHistoryRow} from '../../types/tutorial';
|
|
6
6
|
import {action} from 'storybook/actions';
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ SELECT
|
|
|
12
12
|
"test_task" AS task_id,
|
|
13
13
|
SUBSTRING("test", 1, 1) AS truncated_char`;
|
|
14
14
|
|
|
15
|
-
const filterFields:
|
|
15
|
+
const filterFields: QueryListFilterConfig['fields'] = [
|
|
16
16
|
{id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},
|
|
17
17
|
{id: 'range', type: 'rangeDatePicker', title: 'Period'},
|
|
18
18
|
{
|
|
@@ -30,7 +30,7 @@ const filterFields: QueryHistoryFilterConfig['fields'] = [
|
|
|
30
30
|
const logFilterApply = action('onFilterApply');
|
|
31
31
|
const logFilterReset = action('onFilterReset');
|
|
32
32
|
|
|
33
|
-
const BASE_ITEMS:
|
|
33
|
+
const BASE_ITEMS: QueryListItem<TutorialHistoryRow>[] = [
|
|
34
34
|
{
|
|
35
35
|
id: 1,
|
|
36
36
|
title: 'Getting started with YQL',
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {HistoryHeader, HistoryLayout, RowsList} from '../../modules';
|
|
3
3
|
import i18n from './i18n';
|
|
4
|
-
import {
|
|
5
|
-
QueryHistoryFilterConfig,
|
|
6
|
-
QueryHistoryItem,
|
|
7
|
-
QueryHistorySearchConfig,
|
|
8
|
-
} from '../../types/history';
|
|
4
|
+
import {QueryListFilterConfig, QueryListItem, QueryListSearchConfig} from '../../types/queryList';
|
|
9
5
|
import {TutorialHistoryRow} from '../../types/tutorial';
|
|
10
6
|
import {getListKey} from '../../helpers/getListKey';
|
|
11
7
|
import {TutorialRowContent} from './TutorialRowContent';
|
|
@@ -16,11 +12,11 @@ export type TutorialsHistoryProps<T extends TutorialHistoryRow = TutorialHistory
|
|
|
16
12
|
className?: string;
|
|
17
13
|
title?: string;
|
|
18
14
|
logo?: React.ReactNode;
|
|
19
|
-
search:
|
|
20
|
-
filter?:
|
|
21
|
-
items:
|
|
15
|
+
search: QueryListSearchConfig;
|
|
16
|
+
filter?: QueryListFilterConfig;
|
|
17
|
+
items: QueryListItem<T>[];
|
|
22
18
|
selectedRowId?: T['id'];
|
|
23
|
-
onListItemClick?: (item:
|
|
19
|
+
onListItemClick?: (item: QueryListItem<T>) => void;
|
|
24
20
|
};
|
|
25
21
|
|
|
26
22
|
const block = cn('qp-tutorials-history');
|
package/src/widgets/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export {QueriesHistory} from './QueriesHistory';
|
|
2
2
|
export type {QueriesHistoryProps} from './QueriesHistory';
|
|
3
|
+
export {SavedQueries} from './SavedQueries';
|
|
4
|
+
export type {SavedQueriesProps} from './SavedQueries';
|
|
3
5
|
export {DashboardCharts} from './DashboardCharts';
|
|
4
6
|
export {TutorialsHistory} from './TutorialsHistory';
|
|
5
7
|
export type {TutorialsHistoryProps} from './TutorialsHistory';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { QueryHistoryComparisonConfig, QueryHistoryEditingConfig, QueryHistoryItem, QueryHistoryRow, QueryHistoryRowAction, QueryHistoryRowRenderData, QueryHistoryRowVariant, QueryHistoryVisibleFieldsConfig } from '../../types/history';
|
|
3
|
-
export type HistoryListProps<T extends QueryHistoryRow> = {
|
|
4
|
-
selectedRowId?: T['id'];
|
|
5
|
-
items: QueryHistoryItem<T>[];
|
|
6
|
-
rowVariant?: QueryHistoryRowVariant;
|
|
7
|
-
visibleFields?: QueryHistoryVisibleFieldsConfig<T>;
|
|
8
|
-
editing?: QueryHistoryEditingConfig<T>;
|
|
9
|
-
comparison?: QueryHistoryComparisonConfig<T>;
|
|
10
|
-
getRowActions?: (item: T) => QueryHistoryRowAction<T>[];
|
|
11
|
-
renderRowItem?: (data: QueryHistoryRowRenderData<T>) => React.ReactNode;
|
|
12
|
-
showFiltersHint?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
onItemClick?: (item: QueryHistoryItem<T>, index: number) => void;
|
|
15
|
-
};
|
|
16
|
-
export declare const HistoryList: <T extends QueryHistoryRow>({ renderRowItem, ...props }: HistoryListProps<T>) => React.JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.HistoryList = void 0;
|
|
7
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _RowsList = require("../RowsList");
|
|
11
|
-
var _HistoryRowContent = require("./HistoryRowContent");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
var _excluded = ["renderRowItem"];
|
|
15
|
-
var HistoryList = exports.HistoryList = function HistoryList(_ref) {
|
|
16
|
-
var renderRowItem = _ref.renderRowItem,
|
|
17
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
18
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowsList.RowsList, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
19
|
-
renderRow: function renderRow(data) {
|
|
20
|
-
return renderRowItem ? renderRowItem(data) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_HistoryRowContent.HistoryRowContent, (0, _objectSpread2.default)({}, data));
|
|
21
|
-
}
|
|
22
|
-
}));
|
|
23
|
-
};
|
|
24
|
-
// #sourceMappingURL=HistoryList.js.map
|