@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","QueriesHistory","action","jsx","_jsx","now","Date","min","QUERY","BASE_ITEMS","header","height","id","title","status","engine","mode","startTime","endTime","query","activeFields","fields","filterFields","type","initialValue","items","logFilterApply","logFilterReset","meta","component","tags","parameters","layout","DefaultStory","_useState","concat","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","_useState5","_useState6","visibleFields","setVisibleFields","_useState7","_useState8","compareMode","setCompareMode","_useState9","_useState0","comparedRows","setComparedRows","_useState1","undefined","_useState10","editingId","setEditingId","handleCompareChange","item","selected","result","_toConsumableArray","slice","filter","length","handleCompareCancel","handleEditSubmit","index","findIndex","i","_objectSpread","handleEditCancel","handleCompare","handleOnSearch","data","newItems","_item$query","toLowerCase","searchValue","includes","style","width","children","onChange","hasClear","onUpdate","onApply","onReset","getRowActions","text","onClick","comparison","enabled","comparedRowIds","onCancel","onCompare","editing","rowId","onSubmit","EmptyStory","_useState11","_useState12","Default","render","Empty"],"sources":["QueriesHistory.stories.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {QueriesHistory} from './QueriesHistory';\nimport {\n QueryHistoryFieldKey,\n QueryHistoryFilterConfig,\n QueryHistoryItem,\n QueryHistoryRow,\n QueryHistoryVisibleFieldsConfig,\n} from '../../types/history';\nimport {action} from 'storybook/actions';\n\nconst now = Date.now();\nconst min = 60 * 1000;\n\nconst QUERY = `use test;\n\nSELECT\n \"test_session\" AS session_id,\n \"test_task\" AS task_id,\n SUBSTRING(\"test\", 1, 1) AS truncated_char`;\n\nconst BASE_ITEMS: QueryHistoryItem<QueryHistoryRow>[] = [\n {header: 'Today', height: 28},\n {\n id: 1,\n title: 'Query 1',\n status: 'completed',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 2 * min,\n endTime: now - min,\n query: QUERY,\n height: 52,\n },\n {\n id: 2,\n title: 'Query 2',\n status: 'failed',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 10 * min,\n endTime: now - 9 * min,\n query: QUERY,\n height: 52,\n },\n {\n id: 3,\n title: 'Query 3',\n status: 'running',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - min,\n query: QUERY,\n height: 52,\n },\n {header: 'Yesterday', height: 28},\n {\n id: 4,\n title: 'Query 4',\n status: 'aborted',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 25 * 60 * min,\n endTime: now - 24 * 60 * min,\n query: 'SELECT 1',\n height: 52,\n },\n {\n id: 5,\n title: 'Query 5',\n status: 'draft',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 30 * 60 * min,\n query: QUERY,\n height: 52,\n },\n];\n\ntype VisibleFields = QueryHistoryVisibleFieldsConfig<QueryHistoryRow>['fields'];\nconst activeFields: QueryHistoryFieldKey<QueryHistoryRow>[] = [\n 'duration',\n 'mode',\n 'startTime',\n 'engine',\n 'isPrivate',\n];\nconst fields: VisibleFields = [\n {\n id: 'duration',\n title: 'Duration',\n },\n {\n id: 'mode',\n title: 'Mode',\n },\n {\n id: 'startTime',\n title: 'Start time',\n },\n {\n id: 'engine',\n title: 'Engine',\n },\n {\n id: 'isPrivate',\n title: 'ACO',\n },\n];\n\nconst filterFields: QueryHistoryFilterConfig['fields'] = [\n {id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},\n {id: 'range', type: 'rangeDatePicker', title: 'Period'},\n {\n id: 'dialect',\n type: 'checkboxGroup',\n title: 'Dialect',\n initialValue: [],\n items: [\n {id: 'yql', title: 'YQL'},\n {id: 'sql', title: 'SQL'},\n ],\n },\n];\n\nconst logFilterApply = action('onFilterApply');\nconst logFilterReset = action('onFilterReset');\n\nconst meta: Meta<typeof QueriesHistory> = {\n title: 'Widgets/QueriesHistory',\n component: QueriesHistory,\n tags: ['autodocs'],\n parameters: {\n layout: 'padded',\n },\n};\n\nexport default meta;\ntype Story = StoryObj<typeof QueriesHistory>;\n\nconst DefaultStory = () => {\n const [items, setItems] = useState([...BASE_ITEMS]);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] =\n useState<QueryHistoryFieldKey<QueryHistoryRow>[]>(activeFields);\n const [compareMode, setCompareMode] = useState(false);\n const [comparedRows, setComparedRows] = useState<number[]>([]);\n const [editingId, setEditingId] = useState<number | undefined>(undefined);\n\n const handleCompareChange = (item: QueryHistoryRow, selected: boolean) => {\n const result = selected\n ? [...comparedRows.slice(0, 1), item.id]\n : comparedRows.filter((id) => id !== item.id);\n setComparedRows(result);\n\n if (!result.length) setCompareMode(false);\n };\n\n const handleCompareCancel = () => {\n setComparedRows([]);\n setCompareMode(false);\n };\n\n const handleEditSubmit = (item: QueryHistoryRow, title: string) => {\n const index = items.findIndex((i) => 'id' in i && i.id === item.id);\n if (index < 0) return;\n\n const result = [...items];\n result[index] = {...result[index], title};\n setItems(result);\n setEditingId(undefined);\n };\n\n const handleEditCancel = () => {\n setEditingId(undefined);\n };\n\n const handleCompare = () => {\n action('onCompare')(comparedRows);\n };\n\n const handleOnSearch = (data: {value: string; fullSearch: boolean}) => {\n setSearch(data);\n\n if (!data.value) {\n setItems(BASE_ITEMS);\n return;\n }\n\n const newItems = BASE_ITEMS.filter((item) => {\n if (!('id' in item)) return false;\n\n const title = item.title.toLowerCase();\n const query = item.query?.toLowerCase();\n const searchValue = data.value.toLowerCase();\n\n if (data.fullSearch) {\n return title.includes(searchValue) || query?.includes(searchValue);\n }\n\n return title.includes(searchValue);\n });\n setItems(newItems);\n };\n\n return (\n <div style={{width: 300, height: 500}}>\n <QueriesHistory\n title=\"History\"\n items={items}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: handleOnSearch,\n }}\n filter={{\n fields: filterFields,\n onApply: logFilterApply,\n onReset: logFilterReset('reset'),\n }}\n getRowActions={() => [\n {\n text: 'Compare',\n onClick: (item) => {\n setCompareMode(true);\n setComparedRows([item.id]);\n },\n },\n {\n text: 'Edit',\n onClick: (item) => {\n setEditingId(item.id);\n },\n },\n ]}\n comparison={{\n enabled: compareMode,\n comparedRowIds: comparedRows,\n onChange: handleCompareChange,\n onCancel: handleCompareCancel,\n onCompare: handleCompare,\n }}\n editing={{\n rowId: editingId,\n onSubmit: handleEditSubmit,\n onCancel: handleEditCancel,\n }}\n />\n </div>\n );\n};\n\nconst EmptyStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 300, height: 500}}>\n <QueriesHistory\n title=\"History\"\n items={[]}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: setSearch,\n }}\n />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <DefaultStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAGC,QAAQ,QAAO,OAAO;AAErC,SAAQC,cAAc;AAQtB,SAAQC,MAAM,QAAO,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,IAAMC,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,CAAC;AACtB,IAAME,GAAG,GAAG,EAAE,GAAG,IAAI;AAErB,IAAMC,KAAK,6IAKmC;AAE9C,IAAMC,UAA+C,GAAG,CACpD;EAACC,MAAM,EAAE,OAAO;EAAEC,MAAM,EAAE;AAAE,CAAC,EAC7B;EACIC,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,SAAS;EAChBC,MAAM,EAAE,WAAW;EACnBC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE,YAAY;EAClBC,SAAS,EAAEZ,GAAG,GAAG,CAAC,GAAGE,GAAG;EACxBW,OAAO,EAAEb,GAAG,G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ACH,cAAc;MACXY,KAAK,EAAC,SAAS;MACfY,KAAK,EAAE,EAAG;MACVkB,MAAM,EAAE;QACJH,KAAK,EAAEG,MAAM,CAACH,KAAK;QACnBC,UAAU,EAAEE,MAAM,CAACF,UAAU;QAC7BgD,QAAQ,EAAE,IAAI;QACdC,QAAQ,EAAE9C;MACd;IAAE,CACL;EAAC,CACD,CAAC;AAEd,CAAC;AAED,OAAO,IAAM+D,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQxG,IAAA,CAAC6B,YAAY,IAAE,CAAC;EAAA;AAAA,CAAC;AAC9D,OAAO,IAAM4E,KAAY,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQxG,IAAA,CAACoG,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useState","QueriesHistory","action","jsx","_jsx","now","Date","min","QUERY","BASE_ITEMS","header","height","id","title","status","engine","mode","startTime","endTime","query","activeFields","fields","filterFields","type","initialValue","items","logFilterApply","logFilterReset","meta","component","tags","parameters","layout","DefaultStory","_useState","concat","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","_useState5","_useState6","visibleFields","setVisibleFields","_useState7","_useState8","compareMode","setCompareMode","_useState9","_useState0","comparedRows","setComparedRows","_useState1","undefined","_useState10","editingId","setEditingId","handleCompareChange","item","selected","result","_toConsumableArray","slice","filter","length","handleCompareCancel","handleEditSubmit","index","findIndex","i","_objectSpread","handleEditCancel","handleCompare","handleOnSearch","data","newItems","_item$query","toLowerCase","searchValue","includes","style","width","children","onChange","hasClear","onUpdate","onApply","onReset","getRowActions","text","onClick","comparison","enabled","comparedRowIds","onCancel","onCompare","editing","rowId","onSubmit","EmptyStory","_useState11","_useState12","Default","render","Empty"],"sources":["QueriesHistory.stories.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {QueriesHistory} from './QueriesHistory';\nimport {\n QueryListFieldKey,\n QueryListFilterConfig,\n QueryListItem,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\nimport {action} from 'storybook/actions';\n\nconst now = Date.now();\nconst min = 60 * 1000;\n\nconst QUERY = `use test;\n\nSELECT\n \"test_session\" AS session_id,\n \"test_task\" AS task_id,\n SUBSTRING(\"test\", 1, 1) AS truncated_char`;\n\nconst BASE_ITEMS: QueryListItem<QueryHistoryRow>[] = [\n {header: 'Today', height: 28},\n {\n id: 1,\n title: 'Query 1',\n status: 'completed',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 2 * min,\n endTime: now - min,\n query: QUERY,\n height: 52,\n },\n {\n id: 2,\n title: 'Query 2',\n status: 'failed',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 10 * min,\n endTime: now - 9 * min,\n query: QUERY,\n height: 52,\n },\n {\n id: 3,\n title: 'Query 3',\n status: 'running',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - min,\n query: QUERY,\n height: 52,\n },\n {header: 'Yesterday', height: 28},\n {\n id: 4,\n title: 'Query 4',\n status: 'aborted',\n engine: 'YQL',\n mode: 'Validation',\n startTime: now - 25 * 60 * min,\n endTime: now - 24 * 60 * min,\n query: 'SELECT 1',\n height: 52,\n },\n {\n id: 5,\n title: 'Query 5',\n status: 'draft',\n engine: 'YQL',\n mode: 'Test',\n startTime: now - 30 * 60 * min,\n query: QUERY,\n height: 52,\n },\n];\n\ntype VisibleFields = QueryListVisibleFieldsConfig<QueryHistoryRow>['fields'];\nconst activeFields: QueryListFieldKey<QueryHistoryRow>[] = [\n 'duration',\n 'mode',\n 'startTime',\n 'engine',\n 'isPrivate',\n];\nconst fields: VisibleFields = [\n {\n id: 'duration',\n title: 'Duration',\n },\n {\n id: 'mode',\n title: 'Mode',\n },\n {\n id: 'startTime',\n title: 'Start time',\n },\n {\n id: 'engine',\n title: 'Engine',\n },\n {\n id: 'isPrivate',\n title: 'ACO',\n },\n];\n\nconst filterFields: QueryListFilterConfig['fields'] = [\n {id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},\n {id: 'range', type: 'rangeDatePicker', title: 'Period'},\n {\n id: 'dialect',\n type: 'checkboxGroup',\n title: 'Dialect',\n initialValue: [],\n items: [\n {id: 'yql', title: 'YQL'},\n {id: 'sql', title: 'SQL'},\n ],\n },\n];\n\nconst logFilterApply = action('onFilterApply');\nconst logFilterReset = action('onFilterReset');\n\nconst meta: Meta<typeof QueriesHistory> = {\n title: 'Widgets/QueriesHistory',\n component: QueriesHistory,\n tags: ['autodocs'],\n parameters: {\n layout: 'padded',\n },\n};\n\nexport default meta;\ntype Story = StoryObj<typeof QueriesHistory>;\n\nconst DefaultStory = () => {\n const [items, setItems] = useState([...BASE_ITEMS]);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] =\n useState<QueryListFieldKey<QueryHistoryRow>[]>(activeFields);\n const [compareMode, setCompareMode] = useState(false);\n const [comparedRows, setComparedRows] = useState<number[]>([]);\n const [editingId, setEditingId] = useState<number | undefined>(undefined);\n\n const handleCompareChange = (item: QueryHistoryRow, selected: boolean) => {\n const result = selected\n ? [...comparedRows.slice(0, 1), item.id]\n : comparedRows.filter((id) => id !== item.id);\n setComparedRows(result);\n\n if (!result.length) setCompareMode(false);\n };\n\n const handleCompareCancel = () => {\n setComparedRows([]);\n setCompareMode(false);\n };\n\n const handleEditSubmit = (item: QueryHistoryRow, title: string) => {\n const index = items.findIndex((i) => 'id' in i && i.id === item.id);\n if (index < 0) return;\n\n const result = [...items];\n result[index] = {...result[index], title};\n setItems(result);\n setEditingId(undefined);\n };\n\n const handleEditCancel = () => {\n setEditingId(undefined);\n };\n\n const handleCompare = () => {\n action('onCompare')(comparedRows);\n };\n\n const handleOnSearch = (data: {value: string; fullSearch: boolean}) => {\n setSearch(data);\n\n if (!data.value) {\n setItems(BASE_ITEMS);\n return;\n }\n\n const newItems = BASE_ITEMS.filter((item) => {\n if (!('id' in item)) return false;\n\n const title = item.title.toLowerCase();\n const query = item.query?.toLowerCase();\n const searchValue = data.value.toLowerCase();\n\n if (data.fullSearch) {\n return title.includes(searchValue) || query?.includes(searchValue);\n }\n\n return title.includes(searchValue);\n });\n setItems(newItems);\n };\n\n return (\n <div style={{width: 300, height: 500}}>\n <QueriesHistory\n title=\"History\"\n items={items}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: handleOnSearch,\n }}\n filter={{\n fields: filterFields,\n onApply: logFilterApply,\n onReset: logFilterReset('reset'),\n }}\n getRowActions={() => [\n {\n text: 'Compare',\n onClick: (item) => {\n setCompareMode(true);\n setComparedRows([item.id]);\n },\n },\n {\n text: 'Edit',\n onClick: (item) => {\n setEditingId(item.id);\n },\n },\n ]}\n comparison={{\n enabled: compareMode,\n comparedRowIds: comparedRows,\n onChange: handleCompareChange,\n onCancel: handleCompareCancel,\n onCompare: handleCompare,\n }}\n editing={{\n rowId: editingId,\n onSubmit: handleEditSubmit,\n onCancel: handleEditCancel,\n }}\n />\n </div>\n );\n};\n\nconst EmptyStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 300, height: 500}}>\n <QueriesHistory\n title=\"History\"\n items={[]}\n search={{\n value: search.value,\n fullSearch: search.fullSearch,\n hasClear: true,\n onUpdate: setSearch,\n }}\n />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <DefaultStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAGC,QAAQ,QAAO,OAAO;AAErC,SAAQC,cAAc;AAQtB,SAAQC,MAAM,QAAO,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,IAAMC,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,CAAC;AACtB,IAAME,G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,UAAUA,CAAA,EAAS;EACrB,IAAAC,WAAA,GAA4BzG,QAAQ,CAAC;MAACwC,KAAK,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAC,CAAC;IAAAiE,WAAA,GAAArE,cAAA,CAAAoE,WAAA;IAA7D9D,MAAM,GAAA+D,WAAA;IAAE9D,SAAS,GAAA8D,WAAA;EAExB,oBACItG,IAAA;IAAKiF,KAAK,EAAE;MAACC,KAAK,EAAE,GAAG;MAAE3E,MAAM,EAAE;IAAG,CAAE;IAAA4E,QAAA,eAClCnF,IAAA,CAACH,cAAc;MACXY,KAAK,EAAC,SAAS;MACfY,KAAK,EAAE,EAAG;MACVkB,MAAM,EAAE;QACJH,KAAK,EAAEG,MAAM,CAACH,KAAK;QACnBC,UAAU,EAAEE,MAAM,CAACF,UAAU;QAC7BgD,QAAQ,EAAE,IAAI;QACdC,QAAQ,EAAE9C;MACd;IAAE,CACL;EAAC,CACD,CAAC;AAEd,CAAC;AAED,OAAO,IAAM+D,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQxG,IAAA,CAAC6B,YAAY,IAAE,CAAC;EAAA;AAAA,CAAC;AAC9D,OAAO,IAAM4E,KAAY,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQxG,IAAA,CAACoG,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryListRowRenderData } from '../../../types/queryList';
|
|
3
|
+
import { QueryHistoryRow } from '../../../types/history';
|
|
4
|
+
export declare const HistoryRowContent: <T extends QueryHistoryRow>({ variant, ...data }: QueryListRowRenderData<T>) => React.JSX.Element;
|
package/build/esm/{modules/HistoryList → widgets/QueriesHistory/internal}/HistoryRowContent.js
RENAMED
|
@@ -2,9 +2,8 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["variant"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { HistoryGroupHeader } from "
|
|
6
|
-
import { HistoryRow } from "
|
|
7
|
-
import { HistorySearchRow } from "../HistorySearchRow";
|
|
5
|
+
import { HistoryGroupHeader } from "../../../components";
|
|
6
|
+
import { HistoryRow, HistorySearchRow } from "../../../modules";
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
export var HistoryRowContent = function HistoryRowContent(_ref) {
|
|
10
9
|
var variant = _ref.variant,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","HistoryGroupHeader","HistoryRow","HistorySearchRow","jsx","_jsx","HistoryRowContent","_ref","variant","data","_objectWithoutProperties","_excluded","item","title","header","_objectSpread"],"sources":["HistoryRowContent.tsx"],"sourcesContent":["import React from 'react';\nimport {HistoryGroupHeader} from '../../../components';\nimport {HistoryRow, HistorySearchRow} from '../../../modules';\nimport {QueryListRowRenderData} from '../../../types/queryList';\nimport {QueryHistoryRow} from '../../../types/history';\n\nexport const HistoryRowContent = <T extends QueryHistoryRow>({\n variant,\n ...data\n}: QueryListRowRenderData<T>) => {\n const {item} = data;\n\n if ('header' in item) {\n return <HistoryGroupHeader title={item.header} />;\n }\n\n return variant === 'search' ? (\n <HistorySearchRow {...data} item={item} />\n ) : (\n <HistoryRow {...data} item={item} />\n );\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,kBAAkB;AAC1B,SAAQC,UAAU,EAAEC,gBAAgB;AAA0B,SAAAC,GAAA,IAAAC,IAAA;AAI9D,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAGG;EAAA,IAF7BC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACJC,IAAI,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EAEP,IAAOC,IAAI,GAAIH,IAAI,CAAZG,IAAI;EAEX,IAAI,QAAQ,IAAIA,IAAI,EAAE;IAClB,oBAAOP,IAAA,CAACJ,kBAAkB;MAACY,KAAK,EAAED,IAAI,CAACE;IAAO,CAAE,CAAC;EACrD;EAEA,OAAON,OAAO,KAAK,QAAQ,gBACvBH,IAAA,CAACF,gBAAgB,EAAAY,aAAA,CAAAA,aAAA,KAAKN,IAAI;IAAEG,IAAI,EAAEA;EAAK,EAAE,CAAC,gBAE1CP,IAAA,CAACH,UAAU,EAAAa,aAAA,CAAAA,aAAA,KAAKN,IAAI;IAAEG,IAAI,EAAEA;EAAK,EAAE,CACtC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["QueriesNavigation.scss"],"names":[],"mappings":"AACE;EAEE,2BAAA;EACA,kBAAA;
|
|
1
|
+
{"version":3,"sources":["QueriesNavigation.scss"],"names":[],"mappings":"AAAA;EACE,YAAA;AACF;AACE;EAEE,2BAAA;EACA,kBAAA;AAAJ","file":"QueriesNavigation.css","sourcesContent":[".qp-queries-navigation {\n height: 100%;\n\n &__empty,\n &__error {\n padding: var(--g-spacing-2);\n text-align: center;\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["SavedQueries.scss"],"names":[],"mappings":"AAAA;EACE,YAAA;AACF","file":"SavedQueries.css","sourcesContent":[".qp-saved-queries {\n height: 100%;\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryListComparisonConfig, QueryListEditingConfig, QueryListFilterConfig, QueryListItem, QueryListRowAction, QueryListRowRenderData, QueryListSearchConfig, QueryListVisibleFieldsConfig } from '../../types/queryList';
|
|
3
|
+
import { SavedQuery } from '../../types/savedQueries';
|
|
4
|
+
import './SavedQueries.scss';
|
|
5
|
+
export type SavedQueriesProps<T extends SavedQuery = SavedQuery> = {
|
|
6
|
+
className?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
logo?: React.ReactNode;
|
|
9
|
+
search: QueryListSearchConfig;
|
|
10
|
+
filter?: QueryListFilterConfig;
|
|
11
|
+
items: QueryListItem<T>[];
|
|
12
|
+
selectedRowId?: T['id'];
|
|
13
|
+
editing?: QueryListEditingConfig<T>;
|
|
14
|
+
comparison?: QueryListComparisonConfig<T>;
|
|
15
|
+
visibleFields?: QueryListVisibleFieldsConfig<T>;
|
|
16
|
+
renderAuthor?: (item: T) => React.ReactNode;
|
|
17
|
+
renderRowItem?: (data: QueryListRowRenderData<T>) => React.ReactNode;
|
|
18
|
+
getRowActions?: (item: T) => QueryListRowAction<T>[];
|
|
19
|
+
onListItemClick?: (item: QueryListItem<T>) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const SavedQueries: <T extends SavedQuery>({ title, logo, search, filter, items, selectedRowId, editing, comparison, visibleFields, renderAuthor, renderRowItem, getRowActions, onListItemClick, className, }: SavedQueriesProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import "core-js/modules/es.array.filter.js";
|
|
3
|
+
import "core-js/modules/es.iterator.constructor.js";
|
|
4
|
+
import "core-js/modules/es.iterator.filter.js";
|
|
5
|
+
import "core-js/modules/es.object.to-string.js";
|
|
6
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
7
|
+
import "core-js/modules/es.string.search.js";
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import cn from 'bem-cn-lite';
|
|
10
|
+
import { QueriesList } from "../../modules";
|
|
11
|
+
import i18n from "./i18n";
|
|
12
|
+
import { SavedQueryRowContent } from "./SavedQueryRowContent";
|
|
13
|
+
import "./SavedQueries.css";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
var block = cn('qp-saved-queries');
|
|
16
|
+
export var SavedQueries = function SavedQueries(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
logo = _ref.logo,
|
|
19
|
+
search = _ref.search,
|
|
20
|
+
filter = _ref.filter,
|
|
21
|
+
items = _ref.items,
|
|
22
|
+
selectedRowId = _ref.selectedRowId,
|
|
23
|
+
editing = _ref.editing,
|
|
24
|
+
comparison = _ref.comparison,
|
|
25
|
+
visibleFields = _ref.visibleFields,
|
|
26
|
+
renderAuthor = _ref.renderAuthor,
|
|
27
|
+
renderRowItem = _ref.renderRowItem,
|
|
28
|
+
getRowActions = _ref.getRowActions,
|
|
29
|
+
onListItemClick = _ref.onListItemClick,
|
|
30
|
+
className = _ref.className;
|
|
31
|
+
return /*#__PURE__*/_jsx(QueriesList, {
|
|
32
|
+
className: block(null, className),
|
|
33
|
+
title: title || i18n('title_saved'),
|
|
34
|
+
logo: logo,
|
|
35
|
+
search: search,
|
|
36
|
+
filter: filter,
|
|
37
|
+
items: items,
|
|
38
|
+
selectedRowId: selectedRowId,
|
|
39
|
+
visibleFields: visibleFields,
|
|
40
|
+
editing: editing,
|
|
41
|
+
comparison: comparison,
|
|
42
|
+
getRowActions: getRowActions,
|
|
43
|
+
renderRow: function renderRow(data) {
|
|
44
|
+
return renderRowItem ? renderRowItem(data) : /*#__PURE__*/_jsx(SavedQueryRowContent, _objectSpread(_objectSpread({}, data), {}, {
|
|
45
|
+
renderAuthor: renderAuthor
|
|
46
|
+
}));
|
|
47
|
+
},
|
|
48
|
+
onListItemClick: onListItemClick
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
// #sourceMappingURL=SavedQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","cn","QueriesList","i18n","SavedQueryRowContent","jsx","_jsx","block","SavedQueries","_ref","title","logo","search","filter","items","selectedRowId","editing","comparison","visibleFields","renderAuthor","renderRowItem","getRowActions","onListItemClick","className","renderRow","data","_objectSpread"],"sources":["SavedQueries.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'bem-cn-lite';\nimport {QueriesList} from '../../modules';\nimport {\n QueryListComparisonConfig,\n QueryListEditingConfig,\n QueryListFilterConfig,\n QueryListItem,\n QueryListRowAction,\n QueryListRowRenderData,\n QueryListSearchConfig,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {SavedQuery} from '../../types/savedQueries';\nimport i18n from './i18n';\nimport {SavedQueryRowContent} from './SavedQueryRowContent';\nimport './SavedQueries.scss';\n\nexport type SavedQueriesProps<T extends SavedQuery = SavedQuery> = {\n className?: string;\n title?: string;\n logo?: React.ReactNode;\n search: QueryListSearchConfig;\n filter?: QueryListFilterConfig;\n items: QueryListItem<T>[];\n selectedRowId?: T['id'];\n editing?: QueryListEditingConfig<T>;\n comparison?: QueryListComparisonConfig<T>;\n visibleFields?: QueryListVisibleFieldsConfig<T>;\n renderAuthor?: (item: T) => React.ReactNode;\n renderRowItem?: (data: QueryListRowRenderData<T>) => React.ReactNode;\n getRowActions?: (item: T) => QueryListRowAction<T>[];\n onListItemClick?: (item: QueryListItem<T>) => void;\n};\n\nconst block = cn('qp-saved-queries');\n\nexport const SavedQueries = <T extends SavedQuery>({\n title,\n logo,\n search,\n filter,\n items,\n selectedRowId,\n editing,\n comparison,\n visibleFields,\n renderAuthor,\n renderRowItem,\n getRowActions,\n onListItemClick,\n className,\n}: SavedQueriesProps<T>) => {\n return (\n <QueriesList\n className={block(null, className)}\n title={title || i18n('title_saved')}\n logo={logo}\n search={search}\n filter={filter}\n items={items}\n selectedRowId={selectedRowId}\n visibleFields={visibleFields}\n editing={editing}\n comparison={comparison}\n getRowActions={getRowActions}\n renderRow={(data) =>\n renderRowItem ? (\n renderRowItem(data)\n ) : (\n <SavedQueryRowContent {...data} renderAuthor={renderAuthor} />\n )\n }\n onListItemClick={onListItemClick}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,aAAa;AAC5B,SAAQC,WAAW;AAYnB,OAAOC,IAA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AACF,oBAAoB,EAAAsB,aAAA,CAAAA,aAAA,KAAKD,IAAI;QAAEN,YAAY,EAAEA;MAAa,EAAE,CAChE;IAAA,CACJ;IACDG,eAAe,EAAEA;EAAgB,CACpC,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SavedQueries } from './SavedQueries';
|
|
3
|
+
declare const meta: Meta<typeof SavedQueries>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SavedQueries>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CustomAuthor: Story;
|
|
8
|
+
export declare const Empty: Story;
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import "core-js/modules/es.array.concat.js";
|
|
5
|
+
import "core-js/modules/es.array.filter.js";
|
|
6
|
+
import "core-js/modules/es.array.includes.js";
|
|
7
|
+
import "core-js/modules/es.array.map.js";
|
|
8
|
+
import "core-js/modules/es.array.slice.js";
|
|
9
|
+
import "core-js/modules/es.iterator.constructor.js";
|
|
10
|
+
import "core-js/modules/es.iterator.filter.js";
|
|
11
|
+
import "core-js/modules/es.iterator.map.js";
|
|
12
|
+
import "core-js/modules/es.object.to-string.js";
|
|
13
|
+
import "core-js/modules/es.string.includes.js";
|
|
14
|
+
import React, { useMemo, useState } from 'react';
|
|
15
|
+
import { Text } from '@gravity-ui/uikit';
|
|
16
|
+
import { action } from 'storybook/actions';
|
|
17
|
+
import { SavedQueries } from "./SavedQueries";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
var QUERY = "SELECT\n session_id,\n COUNT(*) AS sessions_count\nFROM visits\nGROUP BY session_id;";
|
|
20
|
+
var BASE_ITEMS = [{
|
|
21
|
+
id: 1,
|
|
22
|
+
title: 'New Query',
|
|
23
|
+
savedAt: '2026-04-29T12:00:00.000Z',
|
|
24
|
+
engine: 'SQL',
|
|
25
|
+
author: 'Anna Petrova',
|
|
26
|
+
query: QUERY,
|
|
27
|
+
height: 52
|
|
28
|
+
}, {
|
|
29
|
+
id: 2,
|
|
30
|
+
title: 'Daily conversion report',
|
|
31
|
+
savedAt: '2026-04-29T11:00:00.000Z',
|
|
32
|
+
engine: 'YQL',
|
|
33
|
+
author: 'Pavel Sidorov',
|
|
34
|
+
query: QUERY,
|
|
35
|
+
height: 52
|
|
36
|
+
}, {
|
|
37
|
+
id: 3,
|
|
38
|
+
title: 'Product funnel',
|
|
39
|
+
savedAt: '2026-04-28T09:00:00.000Z',
|
|
40
|
+
engine: 'SQL',
|
|
41
|
+
author: 'Maria Volkova',
|
|
42
|
+
query: 'SELECT 1;',
|
|
43
|
+
height: 52
|
|
44
|
+
}];
|
|
45
|
+
var filterFields = [{
|
|
46
|
+
id: 'onlyMine',
|
|
47
|
+
type: 'switch',
|
|
48
|
+
title: 'My queries only',
|
|
49
|
+
initialValue: true
|
|
50
|
+
}, {
|
|
51
|
+
id: 'range',
|
|
52
|
+
type: 'rangeDatePicker',
|
|
53
|
+
title: 'Period'
|
|
54
|
+
}, {
|
|
55
|
+
id: 'engine',
|
|
56
|
+
type: 'checkboxGroup',
|
|
57
|
+
title: 'Engine',
|
|
58
|
+
initialValue: [],
|
|
59
|
+
items: [{
|
|
60
|
+
id: 'yql',
|
|
61
|
+
title: 'YQL'
|
|
62
|
+
}, {
|
|
63
|
+
id: 'sql',
|
|
64
|
+
title: 'SQL'
|
|
65
|
+
}]
|
|
66
|
+
}];
|
|
67
|
+
var fields = [{
|
|
68
|
+
id: 'savedAt',
|
|
69
|
+
title: 'Saved date'
|
|
70
|
+
}, {
|
|
71
|
+
id: 'engine',
|
|
72
|
+
title: 'Engine'
|
|
73
|
+
}, {
|
|
74
|
+
id: 'author',
|
|
75
|
+
title: 'Author'
|
|
76
|
+
}];
|
|
77
|
+
var meta = {
|
|
78
|
+
title: 'Widgets/SavedQueries',
|
|
79
|
+
component: SavedQueries,
|
|
80
|
+
tags: ['autodocs'],
|
|
81
|
+
parameters: {
|
|
82
|
+
layout: 'padded'
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
export default meta;
|
|
86
|
+
var SavedQueriesStory = function SavedQueriesStory() {
|
|
87
|
+
var _useState = useState(BASE_ITEMS),
|
|
88
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
89
|
+
items = _useState2[0],
|
|
90
|
+
setItems = _useState2[1];
|
|
91
|
+
var _useState3 = useState({
|
|
92
|
+
value: '',
|
|
93
|
+
fullSearch: false
|
|
94
|
+
}),
|
|
95
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
96
|
+
search = _useState4[0],
|
|
97
|
+
setSearch = _useState4[1];
|
|
98
|
+
var _useState5 = useState(['savedAt', 'engine', 'author']),
|
|
99
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
100
|
+
visibleFields = _useState6[0],
|
|
101
|
+
setVisibleFields = _useState6[1];
|
|
102
|
+
var _useState7 = useState([]),
|
|
103
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
104
|
+
comparedRowIds = _useState8[0],
|
|
105
|
+
setComparedRowIds = _useState8[1];
|
|
106
|
+
var _useState9 = useState(),
|
|
107
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
108
|
+
editingRowId = _useState0[0],
|
|
109
|
+
setEditingRowId = _useState0[1];
|
|
110
|
+
var filteredItems = useMemo(function () {
|
|
111
|
+
if (!search.value) return items;
|
|
112
|
+
var value = search.value.toLowerCase();
|
|
113
|
+
return items.filter(function (item) {
|
|
114
|
+
var _item$query;
|
|
115
|
+
if ('header' in item) return false;
|
|
116
|
+
return search.fullSearch ? item.title.toLowerCase().includes(value) || ((_item$query = item.query) === null || _item$query === void 0 ? void 0 : _item$query.toLowerCase().includes(value)) : item.title.toLowerCase().includes(value);
|
|
117
|
+
});
|
|
118
|
+
}, [items, search]);
|
|
119
|
+
var updateTitle = function updateTitle(item, title) {
|
|
120
|
+
setItems(function (currentItems) {
|
|
121
|
+
return currentItems.map(function (currentItem) {
|
|
122
|
+
return 'id' in currentItem && currentItem.id === item.id ? _objectSpread(_objectSpread({}, currentItem), {}, {
|
|
123
|
+
title: title
|
|
124
|
+
}) : currentItem;
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
setEditingRowId(undefined);
|
|
128
|
+
};
|
|
129
|
+
return /*#__PURE__*/_jsx("div", {
|
|
130
|
+
style: {
|
|
131
|
+
width: 360,
|
|
132
|
+
height: 560
|
|
133
|
+
},
|
|
134
|
+
children: /*#__PURE__*/_jsx(SavedQueries, {
|
|
135
|
+
items: filteredItems,
|
|
136
|
+
search: _objectSpread(_objectSpread({}, search), {}, {
|
|
137
|
+
hasClear: true,
|
|
138
|
+
onUpdate: setSearch
|
|
139
|
+
}),
|
|
140
|
+
filter: {
|
|
141
|
+
fields: filterFields,
|
|
142
|
+
onApply: action('onFilterApply'),
|
|
143
|
+
onReset: action('onFilterReset')
|
|
144
|
+
},
|
|
145
|
+
visibleFields: {
|
|
146
|
+
value: visibleFields,
|
|
147
|
+
fields: fields,
|
|
148
|
+
onChange: setVisibleFields
|
|
149
|
+
},
|
|
150
|
+
editing: {
|
|
151
|
+
rowId: editingRowId,
|
|
152
|
+
onSubmit: updateTitle,
|
|
153
|
+
onCancel: function onCancel() {
|
|
154
|
+
return setEditingRowId(undefined);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
comparison: {
|
|
158
|
+
enabled: Boolean(comparedRowIds.length),
|
|
159
|
+
comparedRowIds: comparedRowIds,
|
|
160
|
+
onChange: function onChange(item, selected) {
|
|
161
|
+
setComparedRowIds(function (currentIds) {
|
|
162
|
+
return selected ? [].concat(_toConsumableArray(currentIds.filter(function (id) {
|
|
163
|
+
return id !== item.id;
|
|
164
|
+
}).slice(-1)), [item.id]) : currentIds.filter(function (id) {
|
|
165
|
+
return id !== item.id;
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
},
|
|
169
|
+
onCancel: function onCancel() {
|
|
170
|
+
return setComparedRowIds([]);
|
|
171
|
+
},
|
|
172
|
+
onCompare: function onCompare() {
|
|
173
|
+
return action('onCompare')(comparedRowIds);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
getRowActions: function getRowActions(item) {
|
|
177
|
+
return [{
|
|
178
|
+
text: 'Copy to',
|
|
179
|
+
onClick: function onClick() {
|
|
180
|
+
return action('onCopyTo')(item);
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
text: 'Show operations',
|
|
184
|
+
onClick: function onClick() {
|
|
185
|
+
return action('onShowOperations')(item);
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
text: 'Edit',
|
|
189
|
+
onClick: function onClick() {
|
|
190
|
+
return setEditingRowId(item.id);
|
|
191
|
+
}
|
|
192
|
+
}, {
|
|
193
|
+
text: 'Compare with baseline',
|
|
194
|
+
onClick: function onClick() {
|
|
195
|
+
return setComparedRowIds([item.id]);
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
text: 'Delete',
|
|
199
|
+
theme: 'danger',
|
|
200
|
+
onClick: function onClick() {
|
|
201
|
+
return action('onDelete')(item);
|
|
202
|
+
}
|
|
203
|
+
}];
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
var CustomAuthorStory = function CustomAuthorStory() {
|
|
209
|
+
var items = BASE_ITEMS.map(function (item) {
|
|
210
|
+
return 'header' in item ? item : _objectSpread(_objectSpread({}, item), {}, {
|
|
211
|
+
team: 'Analytics'
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
var _useState1 = useState({
|
|
215
|
+
value: '',
|
|
216
|
+
fullSearch: false
|
|
217
|
+
}),
|
|
218
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
219
|
+
search = _useState10[0],
|
|
220
|
+
setSearch = _useState10[1];
|
|
221
|
+
return /*#__PURE__*/_jsx("div", {
|
|
222
|
+
style: {
|
|
223
|
+
width: 360,
|
|
224
|
+
height: 280
|
|
225
|
+
},
|
|
226
|
+
children: /*#__PURE__*/_jsx(SavedQueries, {
|
|
227
|
+
items: items,
|
|
228
|
+
search: _objectSpread(_objectSpread({}, search), {}, {
|
|
229
|
+
hasClear: true,
|
|
230
|
+
onUpdate: setSearch
|
|
231
|
+
}),
|
|
232
|
+
renderAuthor: function renderAuthor(item) {
|
|
233
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
234
|
+
color: "complementary",
|
|
235
|
+
children: item.team
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
var EmptyStory = function EmptyStory() {
|
|
242
|
+
var _useState11 = useState({
|
|
243
|
+
value: '',
|
|
244
|
+
fullSearch: false
|
|
245
|
+
}),
|
|
246
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
247
|
+
search = _useState12[0],
|
|
248
|
+
setSearch = _useState12[1];
|
|
249
|
+
return /*#__PURE__*/_jsx("div", {
|
|
250
|
+
style: {
|
|
251
|
+
width: 360,
|
|
252
|
+
height: 280
|
|
253
|
+
},
|
|
254
|
+
children: /*#__PURE__*/_jsx(SavedQueries, {
|
|
255
|
+
items: [],
|
|
256
|
+
search: _objectSpread(_objectSpread({}, search), {}, {
|
|
257
|
+
hasClear: true,
|
|
258
|
+
onUpdate: setSearch
|
|
259
|
+
})
|
|
260
|
+
})
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
export var Default = {
|
|
264
|
+
render: function render() {
|
|
265
|
+
return /*#__PURE__*/_jsx(SavedQueriesStory, {});
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
export var CustomAuthor = {
|
|
269
|
+
render: function render() {
|
|
270
|
+
return /*#__PURE__*/_jsx(CustomAuthorStory, {});
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
export var Empty = {
|
|
274
|
+
render: function render() {
|
|
275
|
+
return /*#__PURE__*/_jsx(EmptyStory, {});
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
// #sourceMappingURL=SavedQueries.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useMemo","useState","Text","action","SavedQueries","jsx","_jsx","QUERY","BASE_ITEMS","id","title","savedAt","engine","author","query","height","filterFields","type","initialValue","items","fields","meta","component","tags","parameters","layout","SavedQueriesStory","_useState","_useState2","_slicedToArray","setItems","_useState3","value","fullSearch","_useState4","search","setSearch","_useState5","_useState6","visibleFields","setVisibleFields","_useState7","_useState8","comparedRowIds","setComparedRowIds","_useState9","_useState0","editingRowId","setEditingRowId","filteredItems","toLowerCase","filter","item","_item$query","includes","updateTitle","currentItems","map","currentItem","_objectSpread","undefined","style","width","children","hasClear","onUpdate","onApply","onReset","onChange","editing","rowId","onSubmit","onCancel","comparison","enabled","Boolean","length","selected","currentIds","concat","_toConsumableArray","slice","onCompare","getRowActions","text","onClick","theme","CustomAuthorStory","team","_useState1","_useState10","renderAuthor","color","EmptyStory","_useState11","_useState12","Default","render","CustomAuthor","Empty"],"sources":["SavedQueries.stories.tsx"],"sourcesContent":["import React, {useMemo, useState} from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {Text} from '@gravity-ui/uikit';\nimport {action} from 'storybook/actions';\nimport {\n QueryListFieldKey,\n QueryListFilterConfig,\n QueryListItem,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {SavedQuery} from '../../types/savedQueries';\nimport {SavedQueries} from './SavedQueries';\n\nconst QUERY = `SELECT\n session_id,\n COUNT(*) AS sessions_count\nFROM visits\nGROUP BY session_id;`;\n\nconst BASE_ITEMS: QueryListItem<SavedQuery>[] = [\n {\n id: 1,\n title: 'New Query',\n savedAt: '2026-04-29T12:00:00.000Z',\n engine: 'SQL',\n author: 'Anna Petrova',\n query: QUERY,\n height: 52,\n },\n {\n id: 2,\n title: 'Daily conversion report',\n savedAt: '2026-04-29T11:00:00.000Z',\n engine: 'YQL',\n author: 'Pavel Sidorov',\n query: QUERY,\n height: 52,\n },\n {\n id: 3,\n title: 'Product funnel',\n savedAt: '2026-04-28T09:00:00.000Z',\n engine: 'SQL',\n author: 'Maria Volkova',\n query: 'SELECT 1;',\n height: 52,\n },\n];\n\nconst filterFields: QueryListFilterConfig['fields'] = [\n {id: 'onlyMine', type: 'switch', title: 'My queries only', initialValue: true},\n {id: 'range', type: 'rangeDatePicker', title: 'Period'},\n {\n id: 'engine',\n type: 'checkboxGroup',\n title: 'Engine',\n initialValue: [],\n items: [\n {id: 'yql', title: 'YQL'},\n {id: 'sql', title: 'SQL'},\n ],\n },\n];\n\nconst fields: QueryListVisibleFieldsConfig<SavedQuery>['fields'] = [\n {id: 'savedAt', title: 'Saved date'},\n {id: 'engine', title: 'Engine'},\n {id: 'author', title: 'Author'},\n];\n\nconst meta: Meta<typeof SavedQueries> = {\n title: 'Widgets/SavedQueries',\n component: SavedQueries,\n tags: ['autodocs'],\n parameters: {layout: 'padded'},\n};\n\nexport default meta;\ntype Story = StoryObj<typeof SavedQueries>;\n\nconst SavedQueriesStory = () => {\n const [items, setItems] = useState(BASE_ITEMS);\n const [search, setSearch] = useState({value: '', fullSearch: false});\n const [visibleFields, setVisibleFields] = useState<QueryListFieldKey<SavedQuery>[]>([\n 'savedAt',\n 'engine',\n 'author',\n ]);\n const [comparedRowIds, setComparedRowIds] = useState<number[]>([]);\n const [editingRowId, setEditingRowId] = useState<number>();\n\n const filteredItems = useMemo(() => {\n if (!search.value) return items;\n\n const value = search.value.toLowerCase();\n return items.filter((item) => {\n if ('header' in item) return false;\n\n return search.fullSearch\n ? item.title.toLowerCase().includes(value) ||\n item.query?.toLowerCase().includes(value)\n : item.title.toLowerCase().includes(value);\n });\n }, [items, search]);\n\n const updateTitle = (item: SavedQuery, title: string) => {\n setItems((currentItems) =>\n currentItems.map((currentItem) =>\n 'id' in currentItem && currentItem.id === item.id\n ? {...currentItem, title}\n : currentItem,\n ),\n );\n setEditingRowId(undefined);\n };\n\n return (\n <div style={{width: 360, height: 560}}>\n <SavedQueries\n items={filteredItems}\n search={{...search, hasClear: true, onUpdate: setSearch}}\n filter={{\n fields: filterFields,\n onApply: action('onFilterApply'),\n onReset: action('onFilterReset'),\n }}\n visibleFields={{value: visibleFields, fields, onChange: setVisibleFields}}\n editing={{\n rowId: editingRowId,\n onSubmit: updateTitle,\n onCancel: () => setEditingRowId(undefined),\n }}\n comparison={{\n enabled: Boolean(comparedRowIds.length),\n comparedRowIds,\n onChange: (item, selected) => {\n setComparedRowIds((currentIds) =>\n selected\n ? [...currentIds.filter((id) => id !== item.id).slice(-1), item.id]\n : currentIds.filter((id) => id !== item.id),\n );\n },\n onCancel: () => setComparedRowIds([]),\n onCompare: () => action('onCompare')(comparedRowIds),\n }}\n getRowActions={(item) => [\n {text: 'Copy to', onClick: () => action('onCopyTo')(item)},\n {text: 'Show operations', onClick: () => action('onShowOperations')(item)},\n {text: 'Edit', onClick: () => setEditingRowId(item.id)},\n {\n text: 'Compare with baseline',\n onClick: () => setComparedRowIds([item.id]),\n },\n {text: 'Delete', theme: 'danger', onClick: () => action('onDelete')(item)},\n ]}\n />\n </div>\n );\n};\n\ntype ExtendedSavedQuery = SavedQuery & {team: string};\n\nconst CustomAuthorStory = () => {\n const items: QueryListItem<ExtendedSavedQuery>[] = BASE_ITEMS.map((item) =>\n 'header' in item ? item : {...item, team: 'Analytics'},\n );\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 360, height: 280}}>\n <SavedQueries\n items={items}\n search={{...search, hasClear: true, onUpdate: setSearch}}\n renderAuthor={(item) => <Text color=\"complementary\">{item.team}</Text>}\n />\n </div>\n );\n};\n\nconst EmptyStory = () => {\n const [search, setSearch] = useState({value: '', fullSearch: false});\n\n return (\n <div style={{width: 360, height: 280}}>\n <SavedQueries items={[]} search={{...search, hasClear: true, onUpdate: setSearch}} />\n </div>\n );\n};\n\nexport const Default: Story = {render: () => <SavedQueriesStory />};\nexport const CustomAuthor: Story = {render: () => <CustomAuthorStory />};\nexport const Empty: Story = {render: () => <EmptyStory />};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAE9C,SAAQC,IAAI,QAAO,mBAAmB;AACtC,SAAQC,MAAM,QAAO,mBAAmB;AAQxC,SAAQC,YAAY;AAAwB,SAAAC,GAAA,IAAAC,IAAA;AAE5C,IAAMC,KAAK,+FAIU;AAErB,IAAMC,UAAuC,GAAG,CAC5C;EACIC,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,WAAW;EAClBC,OAAO,EAAE,0BAA0B;EACnCC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,cAAc;EACtBC,KAAK,EAAEP,KAAK;EACZQ,MAAM,EAAE;AACZ,CAAC,EACD;EACIN,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,yBAAyB;EAChCC,OAAO,EAAE,0BAA0B;EACnCC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,eAAe;EACvBC,KAAK,EAAEP,KAAK;EACZQ,MAAM,EAAE;AACZ,CAAC,EACD;EACIN,EAAE,EAAE,CAAC;EACLC,KAAK,EAAE,gBAAgB;EACvBC,OAAO,EAAE,0BAA0B;EACnCC,MAAM,EAAE,KAAK;EACbC,MAAM,EAAE,eAAe;EACvBC,KAAK,EAAE,WAAW;EAClBC,MAAM,EAAE;AACZ,CAAC,CACJ;AAED,IAAMC,YAA6C,GAAG,CAClD;EAACP,EAAE,EAAE,UAAU;EAAEQ,IAAI,EAAE,QAAQ;EAAEP,KAAK,EAAE,iBAAiB;EAAEQ,YAAY,EAAE;AAAI,CAAC,EAC9E;EAACT,EAAE,EAAE,OAAO;EAAEQ,IAAI,EAAE,iBA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,CAAC;MAAC+B,KAAK,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAK,CAAC,CAAC;IAAA8D,WAAA,GAAAlE,cAAA,CAAAiE,WAAA;IAA7D3D,MAAM,GAAA4D,WAAA;IAAE3D,SAAS,GAAA2D,WAAA;EAExB,oBACIzF,IAAA;IAAKuD,KAAK,EAAE;MAACC,KAAK,EAAE,GAAG;MAAE/C,MAAM,EAAE;IAAG,CAAE;IAAAgD,QAAA,eAClCzD,IAAA,CAACF,YAAY;MAACe,KAAK,EAAE,EAAG;MAACgB,MAAM,EAAAwB,aAAA,CAAAA,aAAA,KAAMxB,MAAM;QAAE6B,QAAQ,EAAE,IAAI;QAAEC,QAAQ,EAAE7B;MAAS;IAAE,CAAE;EAAC,CACpF,CAAC;AAEd,CAAC;AAED,OAAO,IAAM4D,OAAc,GAAG;EAACC,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACoB,iBAAiB,IAAE,CAAC;EAAA;AAAA,CAAC;AACnE,OAAO,IAAMwE,YAAmB,GAAG;EAACD,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACiF,iBAAiB,IAAE,CAAC;EAAA;AAAA,CAAC;AACxE,OAAO,IAAMY,KAAY,GAAG;EAACF,MAAM,EAAE,SAARA,MAAMA,CAAA;IAAA,oBAAQ3F,IAAA,CAACuF,UAAU,IAAE,CAAC;EAAA;AAAA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryListRowRenderData } from '../../types/queryList';
|
|
3
|
+
import { SavedQuery } from '../../types/savedQueries';
|
|
4
|
+
type Props<T extends SavedQuery> = QueryListRowRenderData<T> & {
|
|
5
|
+
renderAuthor?: (item: T) => React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const SavedQueryRowContent: <T extends SavedQuery>({ item, variant, renderAuthor, ...data }: Props<T>) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["item", "variant", "renderAuthor"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { HistoryGroupHeader } from "../../components";
|
|
6
|
+
import { SavedQueryRow, SavedQuerySearchRow } from "../../modules";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export var SavedQueryRowContent = function SavedQueryRowContent(_ref) {
|
|
9
|
+
var item = _ref.item,
|
|
10
|
+
variant = _ref.variant,
|
|
11
|
+
renderAuthor = _ref.renderAuthor,
|
|
12
|
+
data = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
if ('header' in item) {
|
|
14
|
+
return /*#__PURE__*/_jsx(HistoryGroupHeader, {
|
|
15
|
+
title: item.header
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return variant === 'search' ? /*#__PURE__*/_jsx(SavedQuerySearchRow, _objectSpread(_objectSpread({}, data), {}, {
|
|
19
|
+
item: item,
|
|
20
|
+
renderAuthor: renderAuthor
|
|
21
|
+
})) : /*#__PURE__*/_jsx(SavedQueryRow, _objectSpread(_objectSpread({}, data), {}, {
|
|
22
|
+
item: item,
|
|
23
|
+
renderAuthor: renderAuthor
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
// #sourceMappingURL=SavedQueryRowContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","HistoryGroupHeader","SavedQueryRow","SavedQuerySearchRow","jsx","_jsx","SavedQueryRowContent","_ref","item","variant","renderAuthor","data","_objectWithoutProperties","_excluded","title","header","_objectSpread"],"sources":["SavedQueryRowContent.tsx"],"sourcesContent":["import React from 'react';\nimport {HistoryGroupHeader} from '../../components';\nimport {SavedQueryRow, SavedQuerySearchRow} from '../../modules';\nimport {QueryListRowRenderData} from '../../types/queryList';\nimport {SavedQuery} from '../../types/savedQueries';\n\ntype Props<T extends SavedQuery> = QueryListRowRenderData<T> & {\n renderAuthor?: (item: T) => React.ReactNode;\n};\n\nexport const SavedQueryRowContent = <T extends SavedQuery>({\n item,\n variant,\n renderAuthor,\n ...data\n}: Props<T>) => {\n if ('header' in item) {\n return <HistoryGroupHeader title={item.header} />;\n }\n\n return variant === 'search' ? (\n <SavedQuerySearchRow {...data} item={item} renderAuthor={renderAuthor} />\n ) : (\n <SavedQueryRow {...data} item={item} renderAuthor={renderAuthor} />\n );\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,kBAAkB;AAC1B,SAAQC,aAAa,EAAEC,mBAAmB;AAAuB,SAAAC,GAAA,IAAAC,IAAA;AAQjE,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAKjB;EAAA,IAJZC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACTC,IAAI,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAEP,IAAI,QAAQ,IAAIL,IAAI,EAAE;IAClB,oBAAOH,IAAA,CAACJ,kBAAkB;MAACa,KAAK,EAAEN,IAAI,CAACO;IAAO,CAAE,CAAC;EACrD;EAEA,OAAON,OAAO,KAAK,QAAQ,gBACvBJ,IAAA,CAACF,mBAAmB,EAAAa,aAAA,CAAAA,aAAA,KAAKL,IAAI;IAAEH,IAAI,EAAEA,IAAK;IAACE,YAAY,EAAEA;EAAa,EAAE,CAAC,gBAEzEL,IAAA,CAACH,aAAa,EAAAc,aAAA,CAAAA,aAAA,KAAKL,IAAI;IAAEH,IAAI,EAAEA,IAAK;IAACE,YAAY,EAAEA;EAAa,EAAE,CACrE;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["en","ru"],"sources":["dicts.ts"],"sourcesContent":["import en from './en.json';\nimport ru from './ru.json';\n\nexport default {en, ru};\n"],"mappings":"AAAA,OAAOA,EAAE;AACT,OAAOC,EAAE;AAET,eAAe;EAACD,EAAE,EAAFA,EAAE;EAAEC,EAAE,EAAFA;AAAE,CAAC","ignoreList":[]}
|