@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
|
@@ -3,11 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import { Flex, Text } from '@gravity-ui/uikit';
|
|
4
4
|
import "./HistoryRow.css";
|
|
5
5
|
import cn from 'bem-cn-lite';
|
|
6
|
-
import { HistoryPrivateIcon, QueryDuration, QueryStatusIcon, RowLink } from "../../components";
|
|
6
|
+
import { EditableRowTitle, HistoryPrivateIcon, QueryDuration, QueryStatusIcon, RowActionsMenu, RowLink } from "../../components";
|
|
7
7
|
import { formatTime } from "../../helpers/time";
|
|
8
8
|
import { isFieldVisible } from "../../helpers/isFieldVisible";
|
|
9
|
-
import { HistoryRowTitle } from "./HistoryRowTitle";
|
|
10
|
-
import { HistoryRowMenu } from "./HistoryRowMenu";
|
|
11
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
10
|
var block = cn('qp-history-row');
|
|
13
11
|
export var HistoryRow = function HistoryRow(_ref) {
|
|
@@ -41,10 +39,10 @@ export var HistoryRow = function HistoryRow(_ref) {
|
|
|
41
39
|
children: [/*#__PURE__*/_jsxs(Flex, {
|
|
42
40
|
justifyContent: "space-between",
|
|
43
41
|
className: block('header'),
|
|
44
|
-
children: [/*#__PURE__*/_jsx(
|
|
42
|
+
children: [/*#__PURE__*/_jsx(EditableRowTitle, {
|
|
45
43
|
item: item,
|
|
46
44
|
editing: editing
|
|
47
|
-
}), showMenu && /*#__PURE__*/_jsx(
|
|
45
|
+
}), showMenu && /*#__PURE__*/_jsx(RowActionsMenu, {
|
|
48
46
|
item: item,
|
|
49
47
|
actions: actions
|
|
50
48
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Flex","Text","cn","HistoryPrivateIcon","QueryDuration","QueryStatusIcon","RowLink","formatTime","isFieldVisible","
|
|
1
|
+
{"version":3,"names":["React","Flex","Text","cn","EditableRowTitle","HistoryPrivateIcon","QueryDuration","QueryStatusIcon","RowActionsMenu","RowLink","formatTime","isFieldVisible","jsx","_jsx","jsxs","_jsxs","block","HistoryRow","_ref","item","actions","isActive","comparison","editing","visibleFields","href","status","mode","startTime","endTime","engine","isPrivate","isEditing","Boolean","enabled","isComparisonMode","isChecked","checked","showMenu","length","disabled","className","_defineProperty","children","direction","gap","justifyContent","color"],"sources":["HistoryRow.tsx"],"sourcesContent":["import React from 'react';\nimport {QueryListRowRenderData} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\nimport {Flex, Text} from '@gravity-ui/uikit';\nimport './HistoryRow.scss';\nimport cn from 'bem-cn-lite';\nimport {\n EditableRowTitle,\n HistoryPrivateIcon,\n QueryDuration,\n QueryStatusIcon,\n RowActionsMenu,\n RowLink,\n} from '../../components';\nimport {formatTime} from '../../helpers/time';\nimport {isFieldVisible} from '../../helpers/isFieldVisible';\n\nexport type Props<T extends QueryHistoryRow> = {\n item: T;\n} & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;\n\nconst block = cn('qp-history-row');\n\nexport const HistoryRow = <T extends QueryHistoryRow>({\n item,\n actions,\n isActive,\n comparison,\n editing,\n visibleFields,\n}: Props<T>) => {\n const {href, status, mode, startTime, endTime, engine, isPrivate} = item;\n const isEditing = Boolean(editing?.enabled);\n const isComparisonMode = Boolean(comparison?.enabled);\n const isChecked = Boolean(comparison?.checked);\n const showMenu = isActive && Boolean(actions?.length) && !isComparisonMode;\n\n return (\n <RowLink\n href={href}\n disabled={isEditing || isComparisonMode}\n className={block({[status]: true, compared: isChecked})}\n >\n <QueryStatusIcon status={status} />\n <Flex direction=\"column\" gap={1} className={block('right-column')}>\n <Flex justifyContent=\"space-between\" className={block('header')}>\n <EditableRowTitle item={item} editing={editing} />\n {showMenu && <RowActionsMenu item={item} actions={actions} />}\n </Flex>\n <div className={block('data')}>\n {isFieldVisible(visibleFields, 'duration') && startTime && (\n <QueryDuration\n className={block('duration')}\n status={status}\n startTime={startTime}\n endTime={endTime}\n />\n )}\n <Flex gap={2}>\n {isFieldVisible(visibleFields, 'mode') && mode && (\n <Text color=\"complementary\">{mode}</Text>\n )}\n {isFieldVisible(visibleFields, 'startTime') && startTime && (\n <Text color=\"complementary\">{formatTime(startTime)}</Text>\n )}\n {isFieldVisible(visibleFields, 'engine') && engine && (\n <Text color=\"complementary\">{engine}</Text>\n )}\n {isFieldVisible(visibleFields, 'isPrivate') && (\n <HistoryPrivateIcon isPrivate={isPrivate} />\n )}\n </Flex>\n </div>\n </Flex>\n </RowLink>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,mBAAmB;AAC5C;AACA,OAAOC,EAAE,MAAM,aAAa;AAC5B,SACIC,gBAAgB,EAChBC,kBAAkB,EAClBC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,OAAO;AAEX,SAAQC,UAAU;AAClB,SAAQC,cAAc;AAAsC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAM5D,IAAMC,KAAK,GAAGb,EAAE,CAAC,gBAAgB,CAAC;AAElC,OAAO,IAAMc,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EAOP;EAAA,IANZC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,aAAa,GAAAN,IAAA,CAAbM,aAAa;EAEb,IAAOC,IAAI,GAAyDN,IAAI,CAAjEM,IAAI;IAAEC,MAAM,GAAiDP,IAAI,CAA3DO,MAAM;IAAEC,IAAI,GAA2CR,IAAI,CAAnDQ,IAAI;IAAEC,SAAS,GAAgCT,IA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ACW,IAAI,EAAEA,IAAK;UAACC,OAAO,EAAEA;QAAQ,CAAE,CAAC;MAAA,CAC3D,CAAC,eACPL,KAAA;QAAK0B,SAAS,EAAEzB,KAAK,CAAC,MAAM,CAAE;QAAA2B,QAAA,GACzBhC,cAAc,CAACa,aAAa,EAAE,UAAU,CAAC,IAAII,SAAS,iBACnDf,IAAA,CAACP,aAAa;UACVmC,SAAS,EAAEzB,KAAK,CAAC,UAAU,CAAE;UAC7BU,MAAM,EAAEA,MAAO;UACfE,SAAS,EAAEA,SAAU;UACrBC,OAAO,EAAEA;QAAQ,CACpB,CACJ,eACDd,KAAA,CAACd,IAAI;UAAC4C,GAAG,EAAE,CAAE;UAAAF,QAAA,GACRhC,cAAc,CAACa,aAAa,EAAE,MAAM,CAAC,IAAIG,IAAI,iBAC1Cd,IAAA,CAACX,IAAI;YAAC6C,KAAK,EAAC,eAAe;YAAAJ,QAAA,EAAEhB;UAAI,CAAO,CAC3C,EACAhB,cAAc,CAACa,aAAa,EAAE,WAAW,CAAC,IAAII,SAAS,iBACpDf,IAAA,CAACX,IAAI;YAAC6C,KAAK,EAAC,eAAe;YAAAJ,QAAA,EAAEjC,UAAU,CAACkB,SAAS;UAAC,CAAO,CAC5D,EACAjB,cAAc,CAACa,aAAa,EAAE,QAAQ,CAAC,IAAIM,MAAM,iBAC9CjB,IAAA,CAACX,IAAI;YAAC6C,KAAK,EAAC,eAAe;YAAAJ,QAAA,EAAEb;UAAM,CAAO,CAC7C,EACAnB,cAAc,CAACa,aAAa,EAAE,WAAW,CAAC,iBACvCX,IAAA,CAACR,kBAAkB;YAAC0B,SAAS,EAAEA;UAAU,CAAE,CAC9C;QAAA,CACC,CAAC;MAAA,CACN,CAAC;IAAA,CACJ,CAAC;EAAA,CACF,CAAC;AAElB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","HistoryRow","jsx","_jsx","now","Date","min","makeRow","overrides","_objectSpread","id","title","status","engine","mode","isPrivate","startTime","endTime","height","defaultActions","text","onClick","row","alert","concat","meta","component","tags","parameters","layout","args","item","isActive","index","actions","decorators","Story","style","width","children","Default","ComparisonMode","comparison","enabled","checked","ComparisonModeUnchecked","EditingMode","editing","onSubmit","_item","onCancel"],"sources":["HistoryRow.stories.tsx"],"sourcesContent":["import React from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {HistoryRow} from './HistoryRow';\nimport {QueryHistoryRow
|
|
1
|
+
{"version":3,"names":["React","HistoryRow","jsx","_jsx","now","Date","min","makeRow","overrides","_objectSpread","id","title","status","engine","mode","isPrivate","startTime","endTime","height","defaultActions","text","onClick","row","alert","concat","meta","component","tags","parameters","layout","args","item","isActive","index","actions","decorators","Story","style","width","children","Default","ComparisonMode","comparison","enabled","checked","ComparisonModeUnchecked","EditingMode","editing","onSubmit","_item","onCancel"],"sources":["HistoryRow.stories.tsx"],"sourcesContent":["import React from 'react';\nimport type {Meta, StoryObj} from '@storybook/react';\nimport {HistoryRow} from './HistoryRow';\nimport {QueryListRowAction} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\n\nconst now = Date.now();\nconst min = 60 * 1000;\n\nconst makeRow = (overrides: Partial<QueryHistoryRow>): QueryHistoryRow => ({\n id: 1,\n title: 'Query 1',\n status: 'completed',\n engine: 'YQL',\n mode: 'batch',\n isPrivate: false,\n startTime: now - 5 * min,\n endTime: now - min,\n height: 64,\n ...overrides,\n});\n\nconst defaultActions: Array<QueryListRowAction<QueryHistoryRow>> = [\n {text: 'Run again', onClick: (row) => alert(`Run: ${row.title}`)},\n {text: 'Copy', onClick: (row) => alert(`Copy: ${row.title}`)},\n {text: 'Delete', onClick: (row) => alert(`Delete: ${row.title}`)},\n];\n\nconst meta: Meta<typeof HistoryRow> = {\n title: 'Modules/HistoryRow',\n component: HistoryRow,\n tags: ['autodocs'],\n parameters: {\n layout: 'padded',\n },\n args: {\n item: makeRow({}),\n isActive: false,\n index: 0,\n actions: defaultActions,\n },\n decorators: [\n (Story) => (\n <div style={{width: 380}}>\n <Story />\n </div>\n ),\n ],\n};\n\nexport default meta;\ntype Story = StoryObj<typeof HistoryRow>;\n\n/** Default row with a ready-to-use actions menu */\nexport const Default: Story = {\n args: {\n item: makeRow({isPrivate: true}),\n isActive: true,\n },\n};\n\n/** Comparison mode — row highlighted as checked, menu is hidden */\nexport const ComparisonMode: Story = {\n args: {\n comparison: {\n enabled: true,\n checked: true,\n },\n },\n};\n\n/** Comparison mode is enabled globally, but this row is not checked yet */\nexport const ComparisonModeUnchecked: Story = {\n args: {\n comparison: {\n enabled: true,\n checked: false,\n },\n },\n};\n\n/** Title editing mode */\nexport const EditingMode: Story = {\n args: {\n editing: {\n enabled: true,\n onSubmit: (_item, title) => alert(`Saved: ${title}`),\n onCancel: () => alert('Cancelled'),\n },\n },\n};\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAAQC,UAAU;AAAsB,SAAAC,GAAA,IAAAC,IAAA;AAIxC,IAAMC,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,CAAC;AACtB,IAAME,GAAG,GAAG,EAAE,GAAG,IAAI;AAErB,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAIC,SAAmC;EAAA,OAAAC,aAAA;IAChDC,EAAE,EAAE,CAAC;IACLC,KAAK,EAAE,SAAS;IAChBC,MAAM,EAAE,WAAW;IACnBC,MAAM,EAAE,KAAK;IACbC,IAAI,EAAE,OAAO;IACbC,SAAS,EAAE,KAAK;IAChBC,SAAS,EAAEZ,GAAG,GAAG,CAAC,GAAGE,GAAG;IACxBW,OAAO,EAAEb,GAAG,GAAGE,GAAG;IAClBY,MAAM,EAAE;EAAE,GACPV,SAAS;AAAA,CACd;AAEF,IAAMW,cAA0D,GAAG,CAC/D;EAACC,IAAI,EAAE,WAAW;EAAEC,OAAO,EAAE,SAATA,OAAOA,CAAGC,GAAG;IAAA,OAAKC,KAAK,SAAAC,MAAA,CAASF,GAAG,CAACX,KAAK,C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AG;EAC1Cf,IAAI,EAAE;IACFY,UAAU,EAAE;MACRC,OAAO,EAAE,IAAI;MACbC,OAAO,EAAE;IACb;EACJ;AACJ,CAAC;;AAED;AACA,OAAO,IAAME,WAAkB,GAAG;EAC9BhB,IAAI,EAAE;IACFiB,OAAO,EAAE;MACLJ,OAAO,EAAE,IAAI;MACbK,QAAQ,EAAE,SAAVA,QAAQA,CAAGC,KAAK,EAAEtC,KAAK;QAAA,OAAKY,KAAK,WAAAC,MAAA,CAAWb,KAAK,CAAE,CAAC;MAAA;MACpDuC,QAAQ,EAAE,SAAVA,QAAQA,CAAA;QAAA,OAAQ3B,KAAK,CAAC,WAAW,CAAC;MAAA;IACtC;EACJ;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { QueryListRowRenderData } from '../../types/queryList';
|
|
3
|
+
import { QueryHistoryRow } from '../../types/history';
|
|
3
4
|
import './HistorySearchRow.scss';
|
|
4
5
|
export type Props<T extends QueryHistoryRow> = {
|
|
5
6
|
item: T;
|
|
6
|
-
} & Omit<
|
|
7
|
+
} & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;
|
|
7
8
|
export declare const HistorySearchRow: <T extends QueryHistoryRow>({ item, visibleFields, editing, comparison, }: Props<T>) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Flex","Text","HistoryPrivateIcon","QueryDuration","QueryStatusIcon","SearchRowLayout","formatTimeCanonical","isFieldVisible","resolveMonacoLanguage","cn","jsx","_jsx","jsxs","_jsxs","block","HistorySearchRow","_ref","item","visibleFields","editing","comparison","href","status","startTime","endTime","engine","mode","isPrivate","query","language","disabled","Boolean","enabled","className","header","gap","alignItems","children","color"],"sources":["HistorySearchRow.tsx"],"sourcesContent":["import React from 'react';\nimport {Flex, Text} from '@gravity-ui/uikit';\nimport {QueryHistoryRow
|
|
1
|
+
{"version":3,"names":["React","Flex","Text","HistoryPrivateIcon","QueryDuration","QueryStatusIcon","SearchRowLayout","formatTimeCanonical","isFieldVisible","resolveMonacoLanguage","cn","jsx","_jsx","jsxs","_jsxs","block","HistorySearchRow","_ref","item","visibleFields","editing","comparison","href","status","startTime","endTime","engine","mode","isPrivate","query","language","disabled","Boolean","enabled","className","header","gap","alignItems","children","color"],"sources":["HistorySearchRow.tsx"],"sourcesContent":["import React from 'react';\nimport {Flex, Text} from '@gravity-ui/uikit';\nimport {QueryListRowRenderData} from '../../types/queryList';\nimport {QueryHistoryRow} from '../../types/history';\nimport {\n HistoryPrivateIcon,\n QueryDuration,\n QueryStatusIcon,\n SearchRowLayout,\n} from '../../components';\nimport {formatTimeCanonical} from '../../helpers/time';\nimport {isFieldVisible} from '../../helpers/isFieldVisible';\nimport {resolveMonacoLanguage} from './helpers/resolveMonacoLanguage';\nimport './HistorySearchRow.scss';\nimport cn from 'bem-cn-lite';\n\nconst block = cn('qp-history-search-row');\n\nexport type Props<T extends QueryHistoryRow> = {\n item: T;\n} & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;\n\nexport const HistorySearchRow = <T extends QueryHistoryRow>({\n item,\n visibleFields,\n editing,\n comparison,\n}: Props<T>) => {\n const {href, status, startTime, endTime, engine, mode, isPrivate, query} = item;\n\n return (\n <SearchRowLayout\n query={query}\n language={resolveMonacoLanguage(engine)}\n href={href}\n disabled={Boolean(editing?.enabled) || Boolean(comparison?.enabled)}\n className={block()}\n header={\n <Flex gap={2} alignItems=\"center\" className={block('header')}>\n <QueryStatusIcon status={status} className={block('icon')} />\n {isFieldVisible(visibleFields, 'duration') && startTime && (\n <QueryDuration status={status} startTime={startTime} endTime={endTime} />\n )}\n {isFieldVisible(visibleFields, 'mode') && mode && (\n <Text color=\"complementary\">{mode}</Text>\n )}\n {isFieldVisible(visibleFields, 'startTime') && startTime && (\n <Text color=\"complementary\" className={block('start-time')}>\n {formatTimeCanonical(startTime)}\n </Text>\n )}\n {isFieldVisible(visibleFields, 'engine') && engine && (\n <Text color=\"complementary\">{engine}</Text>\n )}\n {isFieldVisible(visibleFields, 'isPrivate') && (\n <HistoryPrivateIcon isPrivate={isPrivate} />\n )}\n </Flex>\n }\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,mBAAmB;AAG5C,SACIC,kBAAkB,EAClBC,aAAa,EACbC,eAAe,EACfC,eAAe;AAEnB,SAAQC,mBAAmB;AAC3B,SAAQC,cAAc;AACtB,SAAQC,qBAAqB;AAC7B;AACA,OAAOC,EAAE,MAAM,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE7B,IAAMC,KAAK,GAAGL,EAAE,CAAC,uBAAuB,CAAC;AAMzC,OAAO,IAAMM,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAKb;EAAA,IAJZC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IACbC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;EAEV,IAAOC,IAAI,GAAgEJ,IAAI,CAAxEI,IAAI;IAAEC,MAAM,GAAwDL,IAAI,CAAlEK,MAAM;IAAEC,SAAS,GAA6CN,IAAI,CAA1DM,SAAS;IAAEC,OAAO,GAAoCP,IAAI,CAA/CO,OAAO;IAAEC,MAAM,GAA4BR,IAAI,CAAtCQ,MAAM;IAAEC,IAAI,GAAsBT,IAAI,CAA9BS,IAAI;IAAEC,SAAS,GAAWV,IAAI,CAAxBU,SAAS;IAAEC,KAAK,GAAIX,IAAI,CAAbW,KAAK;EAEvE,oBACIjB,IAAA,CAACN,eAAe;IACZuB,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAErB,qBAAqB,CAACiB,MAAM,CAAE;IACxCJ,IAAI,EAAEA,IAAK;IACXS,QAAQ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AEA;MAAU,CAAE,CAC9C;IAAA,CACC;EACT,CACJ,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -67,13 +67,7 @@ export var NavigationItemsListHeader = function NavigationItemsListHeader(_ref)
|
|
|
67
67
|
onSortUpdate = _ref.onSortUpdate,
|
|
68
68
|
className = _ref.className;
|
|
69
69
|
if (!onSortUpdate) {
|
|
70
|
-
return
|
|
71
|
-
alignItems: "center",
|
|
72
|
-
className: block(null, className),
|
|
73
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
74
|
-
children: titleLabel
|
|
75
|
-
})
|
|
76
|
-
});
|
|
70
|
+
return null;
|
|
77
71
|
}
|
|
78
72
|
var handleClick = function handleClick() {
|
|
79
73
|
onSortUpdate(sort === 'asc' ? 'desc' : 'asc');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Flex","Icon","Text","ArrowUpIcon","props","_jsx","_objectSpread","children","fill","fillRule","d","clipRule","defaultProps","xmlns","width","height","viewBox","ArrowDownIcon","ArrowUpArrowDownIcon","cn","jsx","jsxs","_jsxs","block","SORT_ICONS","asc","desc","NavigationItemsListHeader","_ref","titleLabel","sort","onSortUpdate","className","
|
|
1
|
+
{"version":3,"names":["React","Flex","Icon","Text","ArrowUpIcon","props","_jsx","_objectSpread","children","fill","fillRule","d","clipRule","defaultProps","xmlns","width","height","viewBox","ArrowDownIcon","ArrowUpArrowDownIcon","cn","jsx","jsxs","_jsxs","block","SORT_ICONS","asc","desc","NavigationItemsListHeader","_ref","titleLabel","sort","onSortUpdate","className","handleClick","icon","alignItems","inline","gap","onClick","data","size"],"sources":["NavigationItemsListHeader.tsx"],"sourcesContent":["import React, {FC} from 'react';\nimport {Flex, Icon, Text} from '@gravity-ui/uikit';\nimport ArrowUpIcon from '@gravity-ui/icons/svgs/arrow-up.svg';\nimport ArrowDownIcon from '@gravity-ui/icons/svgs/arrow-down.svg';\nimport ArrowUpArrowDownIcon from '@gravity-ui/icons/svgs/arrow-up-arrow-down.svg';\nimport cn from 'bem-cn-lite';\nimport {NavigationSortOrder} from '../../../types/navigation';\nimport './NavigationItemsListHeader.scss';\n\nconst block = cn('qp-navigation-items-list-header');\n\nconst SORT_ICONS: Record<NavigationSortOrder, typeof ArrowUpIcon> = {\n asc: ArrowUpIcon,\n desc: ArrowDownIcon,\n};\n\nexport type NavigationItemsListHeaderProps = {\n titleLabel: string;\n sort?: NavigationSortOrder;\n onSortUpdate?: (sort: NavigationSortOrder) => void;\n className?: string;\n};\n\nexport const NavigationItemsListHeader: FC<NavigationItemsListHeaderProps> = ({\n titleLabel,\n sort,\n onSortUpdate,\n className,\n}) => {\n if (!onSortUpdate) {\n return null;\n }\n\n const handleClick = () => {\n onSortUpdate(sort === 'asc' ? 'desc' : 'asc');\n };\n\n const icon = sort ? SORT_ICONS[sort] : ArrowUpArrowDownIcon;\n\n return (\n <Flex alignItems=\"center\" className={block(null, className)}>\n <Flex\n inline\n gap={2}\n alignItems=\"center\"\n className={block('sort')}\n onClick={handleClick}\n >\n <Text>{titleLabel}</Text>\n <Icon data={icon} size={16} />\n </Flex>\n </Flex>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAY,OAAO;AAC/B,SAAQC,IAAI,EAAEC,IAAI,EAAEC,IAAI,QAAO,mBAAmB;AAAC,IAC5CC,WAAW,YAAXA,WAAWA,CAAAC,KAAA;EAAA,oBAAAC,IAAA,QAAAC,aAAA,CAAAA,aAAA,KAAAF,KAAA;IAAAG,QAAA,eAAAF,IAAA;MAAAG,IAAA;MAAAC,QAAA;MAAAC,CAAA;MAAAC,QAAA;IAAA;EAAA;AAAA;AAAXR,WAAW,CAAAS,YAAA;EAAAC,KAAA;EAAAC,KAAA;EAAAC,MAAA;EAAAP,IAAA;EAAAQ,OAAA;AAAA;AAAA,IACXC,aAAa,YAAbA,aAAaA,CAAAb,KAAA;EAAA,oBAAAC,IAAA,QAAAC,aAAA,CAAAA,aAAA,KAAAF,KAAA;IAAAG,QAAA,eAAAF,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BACIb,IAAA,CAACL,IAAI;IAACmC,UAAU,EAAC,QAAQ;IAACH,SAAS,EAAET,KAAK,CAAC,IAAI,EAAES,SAAS,CAAE;IAAAzB,QAAA,eACxDe,KAAA,CAACtB,IAAI;MACDoC,MAAM;MACNC,GAAG,EAAE,CAAE;MACPF,UAAU,EAAC,QAAQ;MACnBH,SAAS,EAAET,KAAK,CAAC,MAAM,CAAE;MACzBe,OAAO,EAAEL,WAAY;MAAA1B,QAAA,gBAErBF,IAAA,CAACH,IAAI;QAAAK,QAAA,EAAEsB;MAAU,CAAO,CAAC,eACzBxB,IAAA,CAACJ,IAAI;QAACsC,IAAI,EAAEL,IAAK;QAACM,IAAI,EAAE;MAAG,CAAE,CAAC;IAAA,CAC5B;EAAC,CACL,CAAC;AAEf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["QueriesList.scss"],"names":[],"mappings":"AAAA;EACE,YAAA;AACF;AACE;EACE,kBAAA;EACA,OAAA;EACA,SAAA;EACA,WAAA;AACJ","file":"QueriesList.css","sourcesContent":[".qp-queries-list {\n height: 100%;\n\n &__comparison-actions {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryListComparisonConfig, QueryListEditingConfig, QueryListFilterConfig, QueryListItem, QueryListRow, QueryListRowAction, QueryListRowRenderData, QueryListSearchConfig, QueryListVisibleFieldsConfig } from '../../types/queryList';
|
|
3
|
+
import './QueriesList.scss';
|
|
4
|
+
export type QueriesListProps<T extends QueryListRow> = {
|
|
5
|
+
className?: string;
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
logo?: React.ReactNode;
|
|
8
|
+
search: QueryListSearchConfig;
|
|
9
|
+
filter?: QueryListFilterConfig;
|
|
10
|
+
items: QueryListItem<T>[];
|
|
11
|
+
selectedRowId?: T['id'];
|
|
12
|
+
editing?: QueryListEditingConfig<T>;
|
|
13
|
+
comparison?: QueryListComparisonConfig<T>;
|
|
14
|
+
visibleFields?: QueryListVisibleFieldsConfig<T>;
|
|
15
|
+
getRowActions?: (item: T) => QueryListRowAction<T>[];
|
|
16
|
+
renderRow: (data: QueryListRowRenderData<T>) => React.ReactNode;
|
|
17
|
+
onListItemClick?: (item: QueryListItem<T>) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const QueriesList: <T extends QueryListRow>({ title, logo, search, filter, items, selectedRowId, editing, comparison, visibleFields, getRowActions, renderRow, onListItemClick, className, }: QueriesListProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
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 "core-js/modules/es.string.trim.js";
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import cn from 'bem-cn-lite';
|
|
11
|
+
import { FieldsSelector } from "../../components";
|
|
12
|
+
import { getListKey } from "../../helpers/getListKey";
|
|
13
|
+
import { HistoryComparisonActions } from "../HistoryComparisonActions";
|
|
14
|
+
import { HistoryHeader } from "../HistoryHeader";
|
|
15
|
+
import { HistoryLayout } from "../HistoryLayout";
|
|
16
|
+
import { RowsList } from "../RowsList";
|
|
17
|
+
import "./QueriesList.css";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
var block = cn('qp-queries-list');
|
|
20
|
+
export var QueriesList = function QueriesList(_ref) {
|
|
21
|
+
var _search$value;
|
|
22
|
+
var title = _ref.title,
|
|
23
|
+
logo = _ref.logo,
|
|
24
|
+
search = _ref.search,
|
|
25
|
+
filter = _ref.filter,
|
|
26
|
+
items = _ref.items,
|
|
27
|
+
selectedRowId = _ref.selectedRowId,
|
|
28
|
+
editing = _ref.editing,
|
|
29
|
+
comparison = _ref.comparison,
|
|
30
|
+
visibleFields = _ref.visibleFields,
|
|
31
|
+
getRowActions = _ref.getRowActions,
|
|
32
|
+
renderRow = _ref.renderRow,
|
|
33
|
+
onListItemClick = _ref.onListItemClick,
|
|
34
|
+
className = _ref.className;
|
|
35
|
+
var showSearchResults = Boolean(search.fullSearch && ((_search$value = search.value) === null || _search$value === void 0 ? void 0 : _search$value.trim()));
|
|
36
|
+
var rowVariant = showSearchResults ? 'search' : 'default';
|
|
37
|
+
return /*#__PURE__*/_jsx(HistoryLayout, {
|
|
38
|
+
className: block(null, className),
|
|
39
|
+
title: title,
|
|
40
|
+
logo: logo,
|
|
41
|
+
actions: visibleFields && /*#__PURE__*/_jsx(FieldsSelector, _objectSpread({}, visibleFields)),
|
|
42
|
+
header: /*#__PURE__*/_jsx(HistoryHeader, {
|
|
43
|
+
className: block('header'),
|
|
44
|
+
search: search.value,
|
|
45
|
+
fullSearch: search.fullSearch,
|
|
46
|
+
hasClear: search.hasClear,
|
|
47
|
+
filter: filter,
|
|
48
|
+
onUpdate: search.onUpdate
|
|
49
|
+
}),
|
|
50
|
+
footer: comparison && /*#__PURE__*/_jsx(HistoryComparisonActions, {
|
|
51
|
+
comparison: comparison,
|
|
52
|
+
className: block('comparison-actions')
|
|
53
|
+
}),
|
|
54
|
+
children: /*#__PURE__*/_jsx(RowsList, {
|
|
55
|
+
items: items,
|
|
56
|
+
rowVariant: rowVariant,
|
|
57
|
+
selectedRowId: selectedRowId,
|
|
58
|
+
visibleFields: visibleFields,
|
|
59
|
+
editing: editing,
|
|
60
|
+
comparison: comparison,
|
|
61
|
+
getRowActions: getRowActions,
|
|
62
|
+
renderRow: renderRow,
|
|
63
|
+
showFiltersHint: Boolean(filter),
|
|
64
|
+
onItemClick: onListItemClick
|
|
65
|
+
}, getListKey(items, rowVariant))
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
// #sourceMappingURL=QueriesList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","cn","FieldsSelector","getListKey","HistoryComparisonActions","HistoryHeader","HistoryLayout","RowsList","jsx","_jsx","block","QueriesList","_ref","_search$value","title","logo","search","filter","items","selectedRowId","editing","comparison","visibleFields","getRowActions","renderRow","onListItemClick","className","showSearchResults","Boolean","fullSearch","value","trim","rowVariant","actions","_objectSpread","header","hasClear","onUpdate","footer","children","showFiltersHint","onItemClick"],"sources":["QueriesList.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'bem-cn-lite';\nimport {FieldsSelector} from '../../components';\nimport {getListKey} from '../../helpers/getListKey';\nimport {\n QueryListComparisonConfig,\n QueryListEditingConfig,\n QueryListFilterConfig,\n QueryListItem,\n QueryListRow,\n QueryListRowAction,\n QueryListRowRenderData,\n QueryListSearchConfig,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {HistoryComparisonActions} from '../HistoryComparisonActions';\nimport {HistoryHeader} from '../HistoryHeader';\nimport {HistoryLayout} from '../HistoryLayout';\nimport {RowsList} from '../RowsList';\nimport './QueriesList.scss';\n\nconst block = cn('qp-queries-list');\n\nexport type QueriesListProps<T extends QueryListRow> = {\n className?: string;\n title: React.ReactNode;\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 getRowActions?: (item: T) => QueryListRowAction<T>[];\n renderRow: (data: QueryListRowRenderData<T>) => React.ReactNode;\n onListItemClick?: (item: QueryListItem<T>) => void;\n};\n\nexport const QueriesList = <T extends QueryListRow>({\n title,\n logo,\n search,\n filter,\n items,\n selectedRowId,\n editing,\n comparison,\n visibleFields,\n getRowActions,\n renderRow,\n onListItemClick,\n className,\n}: QueriesListProps<T>) => {\n const showSearchResults = Boolean(search.fullSearch && search.value?.trim());\n const rowVariant = showSearchResults ? 'search' : 'default';\n\n return (\n <HistoryLayout\n className={block(null, className)}\n title={title}\n logo={logo}\n actions={visibleFields && <FieldsSelector {...visibleFields} />}\n header={\n <HistoryHeader\n className={block('header')}\n search={search.value}\n fullSearch={search.fullSearch}\n hasClear={search.hasClear}\n filter={filter}\n onUpdate={search.onUpdate}\n />\n }\n footer={\n comparison && (\n <HistoryComparisonActions\n comparison={comparison}\n className={block('comparison-actions')}\n />\n )\n }\n >\n <RowsList\n key={getListKey(items, rowVariant)}\n items={items}\n rowVariant={rowVariant}\n selectedRowId={selectedRowId}\n visibleFields={visibleFields}\n editing={editing}\n comparison={comparison}\n getRowActions={getRowActions}\n renderRow={renderRow}\n showFiltersHint={Boolean(filter)}\n onItemClick={onListItemClick}\n />\n </HistoryLayout>\n );\n};\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,aAAa;AAC5B,SAAQC,cAAc;AACtB,SAAQC,UAAU;AAYlB,SAAQC,wBAAwB;AAChC,SAAQC,aAAa;AACrB,SAAQC,aAAa;AACrB,SAAQC,QAAQ;AAChB;AAA4B,SAAAC,GAAA,IAAAC,IAAA;AAE5B,IAAMC,KAAK,GAAGT,EAAE,CAAC,iBAAiB,CAAC;AAkBnC,OAAO,IAAMU,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAcG;EAAA,IAAAC,aAAA;EAAA,IAbvBC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,MAAM,GAAAJ,IAAA,CAANI,MAAM;IACNC,MAAM,GAAAL,IAAA,CAANK,MAAM;IACNC,KAAK,GAAAN,IAAA,CAALM,KAAK;IACLC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,OAAO,GAAAR,IAAA,CA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b,aAAa,EAAEA,aAAc;MAC7BG,aAAa,EAAEA,aAAc;MAC7BF,OAAO,EAAEA,OAAQ;MACjBC,UAAU,EAAEA,UAAW;MACvBE,aAAa,EAAEA,aAAc;MAC7BC,SAAS,EAAEA,SAAU;MACrBgB,eAAe,EAAEZ,OAAO,CAACX,MAAM,CAAE;MACjCwB,WAAW,EAAEhB;IAAgB,GAVxBtB,UAAU,CAACe,KAAK,EAAEc,UAAU,CAWpC;EAAC,CACS,CAAC;AAExB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["QueriesList"],"sources":["index.ts"],"sourcesContent":["export {QueriesList} from './QueriesList';\nexport type {QueriesListProps} from './QueriesList';\n"],"mappings":"AAAA,SAAQA,WAAW","ignoreList":[]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { QueryListComparisonConfig, QueryListEditingConfig, QueryListItem, QueryListRow, QueryListRowAction, QueryListRowRenderData, QueryListRowVariant, QueryListVisibleFieldsConfig } from '../../types/queryList';
|
|
3
3
|
import './RowsList.scss';
|
|
4
|
-
export type RowsListProps<T extends
|
|
5
|
-
items:
|
|
4
|
+
export type RowsListProps<T extends QueryListRow> = {
|
|
5
|
+
items: QueryListItem<T>[];
|
|
6
6
|
selectedRowId?: T['id'];
|
|
7
|
-
rowVariant?:
|
|
8
|
-
visibleFields?:
|
|
9
|
-
editing?:
|
|
10
|
-
comparison?:
|
|
11
|
-
getRowActions?: (item: T) =>
|
|
12
|
-
renderRow: (data:
|
|
7
|
+
rowVariant?: QueryListRowVariant;
|
|
8
|
+
visibleFields?: QueryListVisibleFieldsConfig<T>;
|
|
9
|
+
editing?: QueryListEditingConfig<T>;
|
|
10
|
+
comparison?: QueryListComparisonConfig<T>;
|
|
11
|
+
getRowActions?: (item: T) => QueryListRowAction<T>[];
|
|
12
|
+
renderRow: (data: QueryListRowRenderData<T>) => React.ReactNode;
|
|
13
13
|
showFiltersHint?: boolean;
|
|
14
14
|
className?: string;
|
|
15
|
-
onItemClick?: (item:
|
|
15
|
+
onItemClick?: (item: QueryListItem<T>, index: number) => void;
|
|
16
16
|
};
|
|
17
|
-
export declare const RowsList: <T extends
|
|
17
|
+
export declare const RowsList: <T extends QueryListRow>({ items, selectedRowId, rowVariant, visibleFields, editing, comparison, getRowActions, renderRow, showFiltersHint, className, onItemClick, }: RowsListProps<T>) => React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "core-js/modules/es.array.find-index.js";
|
|
1
2
|
import "core-js/modules/es.array.includes.js";
|
|
2
3
|
import "core-js/modules/es.string.includes.js";
|
|
3
4
|
import React from 'react';
|
|
@@ -24,6 +25,9 @@ export var RowsList = function RowsList(_ref) {
|
|
|
24
25
|
var getItemHeight = function getItemHeight(item) {
|
|
25
26
|
return rowVariant === 'search' && !('header' in item) ? SEARCH_ROW_HEIGHT : item.height;
|
|
26
27
|
};
|
|
28
|
+
var selectedItemIndex = selectedRowId === undefined ? undefined : items.findIndex(function (item) {
|
|
29
|
+
return !('header' in item) && item.id === selectedRowId;
|
|
30
|
+
});
|
|
27
31
|
var handleItemClick = function handleItemClick(item, index) {
|
|
28
32
|
if ('header' in item || !(comparison !== null && comparison !== void 0 && comparison.enabled)) {
|
|
29
33
|
onItemClick === null || onItemClick === void 0 || onItemClick(item, index);
|
|
@@ -54,7 +58,7 @@ export var RowsList = function RowsList(_ref) {
|
|
|
54
58
|
getRowActions: getRowActions
|
|
55
59
|
}));
|
|
56
60
|
},
|
|
57
|
-
selectedItemIndex:
|
|
61
|
+
selectedItemIndex: selectedItemIndex,
|
|
58
62
|
onItemClick: handleItemClick
|
|
59
63
|
});
|
|
60
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","cn","EmptyContent","LazyList","prepareRowData","SEARCH_ROW_HEIGHT","jsx","_jsx","block","RowsList","_ref","items","selectedRowId","_ref$rowVariant","rowVariant","visibleFields","editing","comparison","getRowActions","renderRow","showFiltersHint","className","onItemClick","getItemHeight","item","height","handleItemClick","index","enabled","selected","comparedRowIds","includes","
|
|
1
|
+
{"version":3,"names":["React","cn","EmptyContent","LazyList","prepareRowData","SEARCH_ROW_HEIGHT","jsx","_jsx","block","RowsList","_ref","items","selectedRowId","_ref$rowVariant","rowVariant","visibleFields","editing","comparison","getRowActions","renderRow","showFiltersHint","className","onItemClick","getItemHeight","item","height","selectedItemIndex","undefined","findIndex","id","handleItemClick","index","enabled","selected","comparedRowIds","includes","onChange","length","variant","itemHeight","renderItem","isActive"],"sources":["RowsList.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'bem-cn-lite';\nimport {\n QueryListComparisonConfig,\n QueryListEditingConfig,\n QueryListItem,\n QueryListRow,\n QueryListRowAction,\n QueryListRowRenderData,\n QueryListRowVariant,\n QueryListVisibleFieldsConfig,\n} from '../../types/queryList';\nimport {EmptyContent, LazyList} from '../../components';\nimport {prepareRowData} from './helpers/prepareRowData';\nimport {SEARCH_ROW_HEIGHT} from '../../constants/row';\nimport './RowsList.scss';\n\nconst block = cn('qp-rows-list');\n\nexport type RowsListProps<T extends QueryListRow> = {\n items: QueryListItem<T>[];\n selectedRowId?: T['id'];\n rowVariant?: QueryListRowVariant;\n visibleFields?: QueryListVisibleFieldsConfig<T>;\n editing?: QueryListEditingConfig<T>;\n comparison?: QueryListComparisonConfig<T>;\n getRowActions?: (item: T) => QueryListRowAction<T>[];\n renderRow: (data: QueryListRowRenderData<T>) => React.ReactNode;\n showFiltersHint?: boolean;\n className?: string;\n onItemClick?: (item: QueryListItem<T>, index: number) => void;\n};\n\nexport const RowsList = <T extends QueryListRow>({\n items,\n selectedRowId,\n rowVariant = 'default',\n visibleFields,\n editing,\n comparison,\n getRowActions,\n renderRow,\n showFiltersHint,\n className,\n onItemClick,\n}: RowsListProps<T>) => {\n const getItemHeight = (item: QueryListItem<T>) =>\n rowVariant === 'search' && !('header' in item) ? SEARCH_ROW_HEIGHT : item.height;\n const selectedItemIndex =\n selectedRowId === undefined\n ? undefined\n : items.findIndex((item) => !('header' in item) && item.id === selectedRowId);\n\n const handleItemClick = (item: QueryListItem<T>, index: number) => {\n if ('header' in item || !comparison?.enabled) {\n onItemClick?.(item, index);\n return;\n }\n\n const selected = comparison.comparedRowIds.includes(item.id);\n comparison.onChange(item, !selected);\n };\n\n if (!items.length) {\n return (\n <EmptyContent\n variant={showFiltersHint ? 'nothing-found' : 'no-files'}\n className={className}\n />\n );\n }\n\n return (\n <LazyList<QueryListItem<T>>\n className={block(null, className)}\n items={items}\n itemHeight={getItemHeight}\n renderItem={(item, isActive, index) =>\n renderRow(\n prepareRowData({\n item,\n isActive,\n index,\n variant: rowVariant,\n visibleFields,\n editing,\n comparison,\n getRowActions,\n }),\n )\n }\n selectedItemIndex={selectedItemIndex}\n onItemClick={handleItemClick}\n />\n );\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,aAAa;AAW5B,SAAQC,YAAY,EAAEC,QAAQ;AAC9B,SAAQC,cAAc;AACtB,SAAQC,iBAAiB;AACzB;AAAyB,SAAAC,GAAA,IAAAC,IAAA;AAEzB,IAAMC,KAAK,GAAGP,EAAE,CAAC,cAAc,CAAC;AAgBhC,OAAO,IAAMQ,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAYG;EAAA,IAXpBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAAC,eAAA,GAAAH,IAAA,CACbI,UAAU;IAAVA,UAAU,GAAAD,eAAA,cAAG,SAAS,GAAAA,eAAA;IACtBE,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,OAAO,GAAAN,IAAA,CAAPM,OAAO;IACPC,UAAU,GAAAP,IAAA,CAAVO,UAAU;IACVC,aAAa,GAAAR,IAAA,CAAbQ,aAAa;IACbC,SAAS,GAAAT,IAAA,CAATS,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AEhB,aAAc;IAC1BiB,UAAU,EAAE,SAAZA,UAAUA,CAAGhB,IAAI,EAAEiB,QAAQ,EAAEV,KAAK;MAAA,OAC9BZ,SAAS,CACLf,cAAc,CAAC;QACXoB,IAAI,EAAJA,IAAI;QACJiB,QAAQ,EAARA,QAAQ;QACRV,KAAK,EAALA,KAAK;QACLO,OAAO,EAAExB,UAAU;QACnBC,aAAa,EAAbA,aAAa;QACbC,OAAO,EAAPA,OAAO;QACPC,UAAU,EAAVA,UAAU;QACVC,aAAa,EAAbA;MACJ,CAAC,CACL,CAAC;IAAA,CACJ;IACDQ,iBAAiB,EAAEA,iBAAkB;IACrCJ,WAAW,EAAEQ;EAAgB,CAChC,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Props<T extends
|
|
3
|
-
item:
|
|
1
|
+
import { QueryListComparisonConfig, QueryListEditingConfig, QueryListItem, QueryListRow, QueryListRowAction, QueryListRowRenderData, QueryListRowVariant, QueryListVisibleFieldsConfig } from '../../../types/queryList';
|
|
2
|
+
type Props<T extends QueryListRow> = {
|
|
3
|
+
item: QueryListItem<T>;
|
|
4
4
|
isActive: boolean;
|
|
5
5
|
index: number;
|
|
6
|
-
variant:
|
|
7
|
-
visibleFields?:
|
|
8
|
-
editing?:
|
|
9
|
-
comparison?:
|
|
10
|
-
getRowActions?: (item: T) =>
|
|
6
|
+
variant: QueryListRowVariant;
|
|
7
|
+
visibleFields?: QueryListVisibleFieldsConfig<T>;
|
|
8
|
+
editing?: QueryListEditingConfig<T>;
|
|
9
|
+
comparison?: QueryListComparisonConfig<T>;
|
|
10
|
+
getRowActions?: (item: T) => QueryListRowAction<T>[];
|
|
11
11
|
};
|
|
12
|
-
export declare const prepareRowData: <T extends
|
|
12
|
+
export declare const prepareRowData: <T extends QueryListRow>({ item, isActive, index, variant, visibleFields, editing, comparison, getRowActions, }: Props<T>) => QueryListRowRenderData<T>;
|
|
13
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["prepareRowData","_ref","item","isActive","index","variant","visibleFields","editing","comparison","getRowActions","isRow","actions","undefined","editingData","enabled","rowId","id","onSubmit","onCancel","comparisonData","checked","comparedRowIds","includes"],"sources":["prepareRowData.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"names":["prepareRowData","_ref","item","isActive","index","variant","visibleFields","editing","comparison","getRowActions","isRow","actions","undefined","editingData","enabled","rowId","id","onSubmit","onCancel","comparisonData","checked","comparedRowIds","includes"],"sources":["prepareRowData.ts"],"sourcesContent":["import {\n QueryListComparisonConfig,\n QueryListEditingConfig,\n QueryListItem,\n QueryListRow,\n QueryListRowAction,\n QueryListRowRenderData,\n QueryListRowVariant,\n QueryListVisibleFieldsConfig,\n} from '../../../types/queryList';\n\ntype Props<T extends QueryListRow> = {\n item: QueryListItem<T>;\n isActive: boolean;\n index: number;\n variant: QueryListRowVariant;\n visibleFields?: QueryListVisibleFieldsConfig<T>;\n editing?: QueryListEditingConfig<T>;\n comparison?: QueryListComparisonConfig<T>;\n getRowActions?: (item: T) => QueryListRowAction<T>[];\n};\n\nexport const prepareRowData = <T extends QueryListRow>({\n item,\n isActive,\n index,\n variant,\n visibleFields,\n editing,\n comparison,\n getRowActions,\n}: Props<T>): QueryListRowRenderData<T> => {\n const isRow = !('header' in item);\n const actions = isRow && getRowActions ? getRowActions(item) : undefined;\n const editingData =\n isRow && editing\n ? {\n enabled: editing.rowId === item.id,\n onSubmit: editing.onSubmit,\n onCancel: editing.onCancel,\n }\n : undefined;\n const comparisonData =\n isRow && comparison && comparison.enabled\n ? {\n enabled: true,\n checked: comparison.comparedRowIds.includes(item.id),\n }\n : undefined;\n\n return {\n item,\n index,\n isActive,\n variant,\n visibleFields,\n actions,\n editing: editingData,\n comparison: comparisonData,\n };\n};\n"],"mappings":";;AAsBA,OAAO,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EASgB;EAAA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-row_compared {
|
|
5
|
+
background-color: var(--g-color-base-utility-light);
|
|
6
|
+
}
|
|
7
|
+
.qp-saved-query-row__content {
|
|
8
|
+
min-width: 0;
|
|
9
|
+
}
|
|
10
|
+
.qp-saved-query-row__header {
|
|
11
|
+
height: 20px;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
}
|
|
14
|
+
.qp-saved-query-row__metadata {
|
|
15
|
+
min-width: 0;
|
|
16
|
+
}
|
|
17
|
+
/*# sourceMappingURL=SavedQueryRow.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["SavedQueryRow.scss"],"names":[],"mappings":"AAAA;EACE,YAAA;AACF;AACE;EACE,mDAAA;AACJ;AAEE;EACE,YAAA;AAAJ;AAGE;EACE,YAAA;EACA,YAAA;AADJ;AAIE;EACE,YAAA;AAFJ","file":"SavedQueryRow.css","sourcesContent":[".qp-saved-query-row {\n height: 100%;\n\n &_compared {\n background-color: var(--g-color-base-utility-light);\n }\n\n &__content {\n min-width: 0;\n }\n\n &__header {\n height: 20px;\n min-width: 0;\n }\n\n &__metadata {\n min-width: 0;\n }\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { QueryListRowRenderData } from '../../types/queryList';
|
|
3
|
+
import { SavedQuery } from '../../types/savedQueries';
|
|
4
|
+
import './SavedQueryRow.scss';
|
|
5
|
+
export type SavedQueryRowProps<T extends SavedQuery = SavedQuery> = {
|
|
6
|
+
item: T;
|
|
7
|
+
renderAuthor?: (item: T) => React.ReactNode;
|
|
8
|
+
} & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;
|
|
9
|
+
export declare const SavedQueryRow: <T extends SavedQuery>({ item, actions, isActive, comparison, editing, visibleFields, renderAuthor, }: SavedQueryRowProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import "core-js/modules/es.array.includes.js";
|
|
2
|
+
import "core-js/modules/es.string.includes.js";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Avatar, Flex, Text } from '@gravity-ui/uikit';
|
|
5
|
+
import cn from 'bem-cn-lite';
|
|
6
|
+
import { EditableRowTitle, RowActionsMenu, RowLink } from "../../components";
|
|
7
|
+
import { formatDateCanonical } from "../../helpers/time";
|
|
8
|
+
import "./SavedQueryRow.css";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
var block = cn('qp-saved-query-row');
|
|
11
|
+
export var SavedQueryRow = function SavedQueryRow(_ref) {
|
|
12
|
+
var _renderAuthor;
|
|
13
|
+
var item = _ref.item,
|
|
14
|
+
actions = _ref.actions,
|
|
15
|
+
isActive = _ref.isActive,
|
|
16
|
+
comparison = _ref.comparison,
|
|
17
|
+
editing = _ref.editing,
|
|
18
|
+
visibleFields = _ref.visibleFields,
|
|
19
|
+
renderAuthor = _ref.renderAuthor;
|
|
20
|
+
var author = item.author,
|
|
21
|
+
engine = item.engine,
|
|
22
|
+
href = item.href,
|
|
23
|
+
savedAt = item.savedAt;
|
|
24
|
+
var isEditing = Boolean(editing === null || editing === void 0 ? void 0 : editing.enabled);
|
|
25
|
+
var isComparisonMode = Boolean(comparison === null || comparison === void 0 ? void 0 : comparison.enabled);
|
|
26
|
+
var isChecked = Boolean(comparison === null || comparison === void 0 ? void 0 : comparison.checked);
|
|
27
|
+
var showMenu = isActive && Boolean(actions === null || actions === void 0 ? void 0 : actions.length) && !isComparisonMode;
|
|
28
|
+
var isFieldVisible = function isFieldVisible(field) {
|
|
29
|
+
return visibleFields === undefined || visibleFields.value.includes(field);
|
|
30
|
+
};
|
|
31
|
+
var authorContent = (_renderAuthor = renderAuthor === null || renderAuthor === void 0 ? void 0 : renderAuthor(item)) !== null && _renderAuthor !== void 0 ? _renderAuthor : author ? /*#__PURE__*/_jsx(Avatar, {
|
|
32
|
+
size: "3xs",
|
|
33
|
+
text: author,
|
|
34
|
+
title: author
|
|
35
|
+
}) : null;
|
|
36
|
+
return /*#__PURE__*/_jsx(RowLink, {
|
|
37
|
+
href: href,
|
|
38
|
+
disabled: isEditing || isComparisonMode,
|
|
39
|
+
className: block({
|
|
40
|
+
compared: isChecked
|
|
41
|
+
}),
|
|
42
|
+
children: /*#__PURE__*/_jsxs(Flex, {
|
|
43
|
+
direction: "column",
|
|
44
|
+
gap: 1,
|
|
45
|
+
className: block('content'),
|
|
46
|
+
children: [/*#__PURE__*/_jsxs(Flex, {
|
|
47
|
+
justifyContent: "space-between",
|
|
48
|
+
className: block('header'),
|
|
49
|
+
children: [/*#__PURE__*/_jsx(EditableRowTitle, {
|
|
50
|
+
item: item,
|
|
51
|
+
editing: editing
|
|
52
|
+
}), showMenu && /*#__PURE__*/_jsx(RowActionsMenu, {
|
|
53
|
+
item: item,
|
|
54
|
+
actions: actions
|
|
55
|
+
})]
|
|
56
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
57
|
+
gap: 2,
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
className: block('metadata'),
|
|
60
|
+
children: [isFieldVisible('savedAt') && savedAt && /*#__PURE__*/_jsx(Text, {
|
|
61
|
+
color: "complementary",
|
|
62
|
+
children: formatDateCanonical(savedAt)
|
|
63
|
+
}), isFieldVisible('engine') && engine && /*#__PURE__*/_jsx(Text, {
|
|
64
|
+
color: "complementary",
|
|
65
|
+
children: engine
|
|
66
|
+
}), isFieldVisible('author') && authorContent]
|
|
67
|
+
})]
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
// #sourceMappingURL=SavedQueryRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Avatar","Flex","Text","cn","EditableRowTitle","RowActionsMenu","RowLink","formatDateCanonical","jsx","_jsx","jsxs","_jsxs","block","SavedQueryRow","_ref","_renderAuthor","item","actions","isActive","comparison","editing","visibleFields","renderAuthor","author","engine","href","savedAt","isEditing","Boolean","enabled","isComparisonMode","isChecked","checked","showMenu","length","isFieldVisible","field","undefined","value","includes","authorContent","size","text","title","disabled","className","compared","children","direction","gap","justifyContent","alignItems","color"],"sources":["SavedQueryRow.tsx"],"sourcesContent":["import React from 'react';\nimport {Avatar, Flex, Text} from '@gravity-ui/uikit';\nimport cn from 'bem-cn-lite';\nimport {EditableRowTitle, RowActionsMenu, RowLink} from '../../components';\nimport {formatDateCanonical} from '../../helpers/time';\nimport {QueryListRowRenderData} from '../../types/queryList';\nimport {SavedQuery} from '../../types/savedQueries';\nimport './SavedQueryRow.scss';\n\nconst block = cn('qp-saved-query-row');\n\nexport type SavedQueryRowProps<T extends SavedQuery = SavedQuery> = {\n item: T;\n renderAuthor?: (item: T) => React.ReactNode;\n} & Omit<QueryListRowRenderData<T>, 'item' | 'variant'>;\n\nexport const SavedQueryRow = <T extends SavedQuery>({\n item,\n actions,\n isActive,\n comparison,\n editing,\n visibleFields,\n renderAuthor,\n}: SavedQueryRowProps<T>) => {\n const {author, engine, href, savedAt} = item;\n const isEditing = Boolean(editing?.enabled);\n const isComparisonMode = Boolean(comparison?.enabled);\n const isChecked = Boolean(comparison?.checked);\n const showMenu = isActive && Boolean(actions?.length) && !isComparisonMode;\n const isFieldVisible = (field: string) =>\n visibleFields === undefined || (visibleFields.value as string[]).includes(field);\n const authorContent =\n renderAuthor?.(item) ??\n (author ? <Avatar size=\"3xs\" text={author} title={author} /> : null);\n\n return (\n <RowLink\n href={href}\n disabled={isEditing || isComparisonMode}\n className={block({compared: isChecked})}\n >\n <Flex direction=\"column\" gap={1} className={block('content')}>\n <Flex justifyContent=\"space-between\" className={block('header')}>\n <EditableRowTitle item={item} editing={editing} />\n {showMenu && <RowActionsMenu item={item} actions={actions} />}\n </Flex>\n <Flex gap={2} alignItems=\"center\" className={block('metadata')}>\n {isFieldVisible('savedAt') && savedAt && (\n <Text color=\"complementary\">{formatDateCanonical(savedAt)}</Text>\n )}\n {isFieldVisible('engine') && engine && (\n <Text color=\"complementary\">{engine}</Text>\n )}\n {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AAU,EAAC,QAAQ;QAACN,SAAS,EAAEjC,KAAK,CAAC,UAAU,CAAE;QAAAmC,QAAA,GAC1DZ,cAAc,CAAC,SAAS,CAAC,IAAIT,OAAO,iBACjCjB,IAAA,CAACP,IAAI;UAACkD,KAAK,EAAC,eAAe;UAAAL,QAAA,EAAExC,mBAAmB,CAACmB,OAAO;QAAC,CAAO,CACnE,EACAS,cAAc,CAAC,QAAQ,CAAC,IAAIX,MAAM,iBAC/Bf,IAAA,CAACP,IAAI;UAACkD,KAAK,EAAC,eAAe;UAAAL,QAAA,EAAEvB;QAAM,CAAO,CAC7C,EACAW,cAAc,CAAC,QAAQ,CAAC,IAAIK,aAAa;MAAA,CACxC,CAAC;IAAA,CACL;EAAC,CACF,CAAC;AAElB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.qp-saved-query-row {
|
|
2
|
+
height: 100%;
|
|
3
|
+
|
|
4
|
+
&_compared {
|
|
5
|
+
background-color: var(--g-color-base-utility-light);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&__content {
|
|
9
|
+
min-width: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__header {
|
|
13
|
+
height: 20px;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__metadata {
|
|
18
|
+
min-width: 0;
|
|
19
|
+
}
|
|
20
|
+
}
|