@synerise/ds-item-picker 1.7.1 → 1.8.1

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/ItemPicker.d.ts +2 -1
  3. package/dist/components/ItemPickerList/ItemPickerList.d.ts +1 -1
  4. package/dist/components/ItemPickerList/ItemPickerList.js +40 -19
  5. package/dist/components/ItemPickerList/ItemPickerList.styles.js +3 -2
  6. package/dist/components/ItemPickerList/ItemPickerList.types.d.ts +5 -3
  7. package/dist/components/ItemPickerList/components/EmptyListMessage.d.ts +2 -2
  8. package/dist/components/ItemPickerList/components/EmptyListMessage.js +2 -2
  9. package/dist/components/ItemPickerList/components/ListSearchInput.d.ts +6 -5
  10. package/dist/components/ItemPickerList/components/ListSearchInput.js +9 -10
  11. package/dist/components/ItemPickerList/constants.d.ts +2 -1
  12. package/dist/components/ItemPickerList/constants.js +1 -0
  13. package/dist/components/ItemPickerList/hooks/useFlattenFolders.d.ts +4 -26
  14. package/dist/components/ItemPickerList/hooks/useItemsInSections.d.ts +10 -5
  15. package/dist/components/ItemPickerList/hooks/useItemsInSections.js +179 -125
  16. package/dist/components/ItemPickerList/hooks/useItemsInSections.utils.d.ts +1 -20
  17. package/dist/components/ItemPickerList/hooks/useItemsInSections.utils.js +20 -77
  18. package/dist/components/ItemPickerList/utils/actionItemsUtils.d.ts +101 -0
  19. package/dist/components/ItemPickerList/utils/actionItemsUtils.js +115 -0
  20. package/dist/components/ItemPickerList/utils/findSectionById.d.ts +1 -1
  21. package/dist/components/ItemPickerList/utils/getContextAwareActions.d.ts +2 -0
  22. package/dist/components/ItemPickerList/utils/getContextAwareActions.js +25 -0
  23. package/dist/components/ItemPickerList/utils/getSearchByActionItems.d.ts +10 -0
  24. package/dist/components/ItemPickerList/utils/{getSearchActionItems.js → getSearchByActionItems.js} +7 -6
  25. package/dist/components/ItemPickerList/utils/resolveSectionId.d.ts +12 -0
  26. package/dist/components/ItemPickerList/utils/resolveSectionId.js +23 -0
  27. package/dist/components/ItemPickerList/utils/typeguards.utils.d.ts +5 -2
  28. package/dist/components/ItemPickerList/utils/typeguards.utils.js +6 -2
  29. package/dist/components/ItemPickerNew/ItemPickerNew.d.ts +2 -1
  30. package/dist/components/ItemPickerNew/ItemPickerNew.types.d.ts +2 -42
  31. package/dist/components/ItemPickerNew/types/actions.types.d.ts +48 -0
  32. package/dist/components/ItemPickerNew/types/actions.types.js +7 -0
  33. package/dist/components/ItemPickerNew/types/baseItemSectionType.types.d.ts +15 -0
  34. package/dist/components/ItemPickerNew/types/baseItemSectionType.types.js +1 -0
  35. package/dist/index.d.ts +3 -1
  36. package/package.json +3 -3
  37. package/dist/components/ItemPickerList/utils/getGlobalOrLocalSearchActionType.d.ts +0 -2
  38. package/dist/components/ItemPickerList/utils/getGlobalOrLocalSearchActionType.js +0 -7
  39. package/dist/components/ItemPickerList/utils/getSearchActionItems.d.ts +0 -10
  40. package/dist/components/ItemPickerList/utils/getSearchActionSectionLabel.d.ts +0 -3
  41. package/dist/components/ItemPickerList/utils/getSearchActionSectionLabel.js +0 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.8.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-item-picker@1.8.0...@synerise/ds-item-picker@1.8.1) (2025-07-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **item-picker:** back action overflow with ellipsis ([c35f1c2](https://github.com/Synerise/synerise-design/commit/c35f1c2340e4fd905e9df0e723856d192c8f4d6c))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.8.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-item-picker@1.7.1...@synerise/ds-item-picker@1.8.0) (2025-07-11)
18
+
19
+
20
+ ### Features
21
+
22
+ * **item-picker:** add search in action ([e7517f6](https://github.com/Synerise/synerise-design/commit/e7517f68961535b6e9d2ccc39c6ad64e2c76a066))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [1.7.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-item-picker@1.7.0...@synerise/ds-item-picker@1.7.1) (2025-07-08)
7
29
 
8
30
  **Note:** Version bump only for package @synerise/ds-item-picker
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { type ItemPickerProps } from './components/ItemPickerLegacy/ItemPickerLegacy.types';
3
- import type { BaseItemType, BaseSectionType, ItemPickerProps as ItemPickerPropsNew } from './components/ItemPickerNew/ItemPickerNew.types';
3
+ import type { ItemPickerProps as ItemPickerPropsNew } from './components/ItemPickerNew/ItemPickerNew.types';
4
+ import type { BaseItemType, BaseSectionType } from './components/ItemPickerNew/types/baseItemSectionType.types';
4
5
  declare const ItemPicker: <ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined>(props: ItemPickerProps<import("@synerise/ds-list-item").ListItemProps> | ItemPickerPropsNew<ItemType, SectionType>) => React.JSX.Element;
5
6
  export default ItemPicker;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { BaseItemType, BaseSectionType } from '../ItemPickerNew/ItemPickerNew.types';
2
+ import type { BaseItemType, BaseSectionType } from '../ItemPickerNew/types/baseItemSectionType.types';
3
3
  import type { ItemPickerListProps } from './ItemPickerList.types';
4
4
  export declare const ItemPickerList: <ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined>({ items, recents, sections, actions, texts, isLoading, selectedItem, scrollbarProps, searchBarProps, showItemsSectionLabel, onItemSelect, onRefresh, containerHeight, isVisible, onSectionChange, containerRef: forwardedRef, includeFooter, includeSearchBar, onLoadedData, ...htmlAttributes }: ItemPickerListProps<ItemType, SectionType>) => React.JSX.Element;
5
5
  export default ItemPickerList;
@@ -8,6 +8,7 @@ import { useTheme } from '@synerise/ds-core';
8
8
  import Dropdown from '@synerise/ds-dropdown';
9
9
  import Icon, { ArrowLeftM } from '@synerise/ds-icon';
10
10
  import { itemSizes } from '@synerise/ds-list-item';
11
+ import { Text } from '@synerise/ds-typography';
11
12
  import { focusWithArrowKeys, useCombinedRefs, useKeyboardShortcuts, useScrollContain } from '@synerise/ds-utils';
12
13
  import { useDefaultTexts } from '../../hooks/useDefaultTexts';
13
14
  import * as S from './ItemPickerList.styles';
@@ -16,7 +17,6 @@ import { ListSearchInput } from './components/ListSearchInput';
16
17
  import { ITEM_SIZE, LIST_INNER_PADDING, LIST_STYLE, SECTION_HEADER_HEIGHT } from './constants';
17
18
  import { useItemsInSections, useListHeight } from './hooks';
18
19
  import { findSectionById, isNavKey, isTitle } from './utils';
19
- import { getSearchActionSectionLabel } from './utils/getSearchActionSectionLabel';
20
20
  export var ItemPickerList = function ItemPickerList(_ref) {
21
21
  var items = _ref.items,
22
22
  recents = _ref.recents,
@@ -99,10 +99,13 @@ export var ItemPickerList = function ItemPickerList(_ref) {
99
99
  refreshItems = _useItemsInSections.refreshItems,
100
100
  refreshEnabled = _useItemsInSections.refreshEnabled,
101
101
  contentHeight = _useItemsInSections.contentHeight,
102
- searchParamConfig = _useItemsInSections.searchParamConfig,
103
- setSearchParamConfig = _useItemsInSections.setSearchParamConfig,
104
- searchActionSection = _useItemsInSections.searchActionSection,
105
- listActions = _useItemsInSections.listActions;
102
+ searchByParamConfig = _useItemsInSections.searchByParamConfig,
103
+ setSearchByParamConfig = _useItemsInSections.setSearchByParamConfig,
104
+ searchByAction = _useItemsInSections.searchByAction,
105
+ listActions = _useItemsInSections.listActions,
106
+ searchInAction = _useItemsInSections.searchInAction,
107
+ searchInItem = _useItemsInSections.searchInItem,
108
+ canPerformListActions = _useItemsInSections.canPerformListActions;
106
109
  var handleScroll = useCallback(function (_ref2) {
107
110
  var currentTarget = _ref2.currentTarget;
108
111
  var scrollTop = currentTarget.scrollTop,
@@ -149,7 +152,7 @@ export var ItemPickerList = function ItemPickerList(_ref) {
149
152
  }, [mergedItemsList, classNames, getItemSize, allTexts, isLoadingMore, isLoadedAll, isLoadingMoreError]);
150
153
  var handleRefresh = onRefresh || refreshItems ? function () {
151
154
  changeSearchQuery('');
152
- setSearchParamConfig(undefined);
155
+ setSearchByParamConfig(undefined);
153
156
  resetCurrentSection();
154
157
  onRefresh && onRefresh();
155
158
  if (refreshItems) {
@@ -166,7 +169,8 @@ export var ItemPickerList = function ItemPickerList(_ref) {
166
169
  outerWrapperHeight = _ref3.outerWrapperHeight,
167
170
  listWrapperHeight = _ref3.listWrapperHeight,
168
171
  offsetSpace = _ref3.offsetSpace;
169
- var isSection = Boolean(currentSection || searchActionSection);
172
+ var isActionSection = Boolean(searchByAction || searchInAction || searchInItem);
173
+ var isSection = Boolean(currentSection || isActionSection);
170
174
  var listHeight = (isSection ? listWrapperHeight - SECTION_HEADER_HEIGHT : listWrapperHeight) - LIST_INNER_PADDING;
171
175
  var clearSearchQuery = function clearSearchQuery() {
172
176
  changeSearchQuery('');
@@ -183,6 +187,18 @@ export var ItemPickerList = function ItemPickerList(_ref) {
183
187
  wrapperHeight: listWrapperHeight
184
188
  });
185
189
  }
190
+ var getSectionLabel = function getSectionLabel() {
191
+ var itemsPath = currentPath || [currentSection == null ? void 0 : currentSection.text];
192
+ var searchByActionLabel = (searchByAction == null ? void 0 : searchByAction.sectionTitle) || (searchByAction == null ? void 0 : searchByAction.text);
193
+ var searchInActionLabel = searchInAction == null ? void 0 : searchInAction.text;
194
+ var searchInItemLabel = searchInItem && "" + (searchInAction == null ? void 0 : searchInAction.renderSearchInValueText(searchInItem));
195
+ var labelParts = [].concat(itemsPath, [searchInActionLabel, searchInItemLabel, searchByActionLabel]).filter(Boolean).join(' - ');
196
+ return /*#__PURE__*/React.createElement(Text, {
197
+ ellipsis: {
198
+ tooltip: labelParts
199
+ }
200
+ }, labelParts);
201
+ };
186
202
  return /*#__PURE__*/React.createElement(React.Fragment, null, isSection && /*#__PURE__*/React.createElement(Dropdown.BackAction, {
187
203
  tooltipProps: {
188
204
  title: allTexts.backTooltip,
@@ -193,7 +209,7 @@ export var ItemPickerList = function ItemPickerList(_ref) {
193
209
  component: /*#__PURE__*/React.createElement(ArrowLeftM, null)
194
210
  })]
195
211
  },
196
- label: getSearchActionSectionLabel(searchActionSection) || (currentPath ? currentPath.join(' - ') : currentSection == null ? void 0 : currentSection.text),
212
+ label: getSectionLabel(),
197
213
  onClick: goBack
198
214
  }), (mergedItemsList == null ? void 0 : mergedItemsList.length) === 0 ? /*#__PURE__*/React.createElement(EmptyListMessage, {
199
215
  buttonOnClick: function buttonOnClick() {
@@ -202,7 +218,7 @@ export var ItemPickerList = function ItemPickerList(_ref) {
202
218
  listActions: listActions,
203
219
  hasCurrentSection: isSection,
204
220
  texts: allTexts,
205
- isSearchSection: !!searchActionSection
221
+ isActionSection: isActionSection
206
222
  }) : /*#__PURE__*/React.createElement(S.StyledScrollbar, _extends({
207
223
  withSectionHeader: isSection,
208
224
  maxHeight: listHeight,
@@ -233,7 +249,7 @@ export var ItemPickerList = function ItemPickerList(_ref) {
233
249
  if (isVisible) {
234
250
  resetCurrentSection();
235
251
  clearSearchQuery();
236
- setSearchParamConfig(undefined);
252
+ setSearchByParamConfig(undefined);
237
253
  setTimeout(focusSearchInput, 0);
238
254
  }
239
255
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -246,7 +262,7 @@ export var ItemPickerList = function ItemPickerList(_ref) {
246
262
  listRef.current.resetAfterIndex(0);
247
263
  setTimeout(focusSearchInput, 0);
248
264
  }
249
- }, [searchActionSection, searchParamConfig, currentSection, focusSearchInput]);
265
+ }, [searchByAction, searchByParamConfig, searchInAction, searchInItem, currentSection, focusSearchInput]);
250
266
  useEffect(function () {
251
267
  listRef.current && listRef.current.resetAfterIndex(0);
252
268
  }, [mergedItemsList]);
@@ -256,8 +272,13 @@ export var ItemPickerList = function ItemPickerList(_ref) {
256
272
  if (!((_combinedScrollRef$cu = combinedScrollRef.current) != null && _combinedScrollRef$cu.offsetParent)) {
257
273
  return;
258
274
  }
259
- (event.metaKey || event.ctrlKey) && currentSection && resetCurrentSection();
260
- event.preventDefault();
275
+ var isMetaOrCtrlKey = event.metaKey || event.ctrlKey;
276
+ if (isMetaOrCtrlKey) {
277
+ event.preventDefault();
278
+ event.stopPropagation();
279
+ goBack();
280
+ return;
281
+ }
261
282
  },
262
283
  Escape: function Escape(event) {
263
284
  var _combinedScrollRef$cu2;
@@ -270,10 +291,10 @@ export var ItemPickerList = function ItemPickerList(_ref) {
270
291
  clearSearchQuery();
271
292
  return;
272
293
  }
273
- if (searchParamConfig) {
294
+ if (searchByParamConfig) {
274
295
  event.preventDefault();
275
296
  event.stopPropagation();
276
- setSearchParamConfig(undefined);
297
+ setSearchByParamConfig(undefined);
277
298
  }
278
299
  }
279
300
  });
@@ -286,14 +307,14 @@ export var ItemPickerList = function ItemPickerList(_ref) {
286
307
  wrapperHeight: outerWrapperHeight
287
308
  }, htmlAttributes), includeSearchBar && /*#__PURE__*/React.createElement(ListSearchInput, {
288
309
  clearSearchQuery: clearSearchQuery,
289
- searchParamConfig: searchParamConfig,
290
- searchActionSection: searchActionSection,
291
- setSearchParamConfig: setSearchParamConfig,
310
+ searchByParamConfig: searchByParamConfig,
311
+ setSearchByParamConfig: setSearchByParamConfig,
292
312
  searchBarProps: searchBarProps,
293
313
  debouncedChangeSearchQuery: debouncedSearchQueryChange,
294
314
  inputRef: inputRef,
295
315
  changeLocalSearchQueryRef: changeLocalSearchQueryRef,
296
- allTexts: allTexts
316
+ allTexts: allTexts,
317
+ canPerformListActions: canPerformListActions
297
318
  }), /*#__PURE__*/React.createElement(S.ListWrapper, {
298
319
  "data-testid": "list-wrapper",
299
320
  ref: scrollContainRef,
@@ -1,6 +1,7 @@
1
1
  import { VariableSizeList } from 'react-window';
2
2
  import styled, { css } from 'styled-components';
3
3
  import Dropdown from '@synerise/ds-dropdown';
4
+ import { Label as DropdownBackActionLabel } from '@synerise/ds-dropdown/dist/elements/BackAction/BackAction.styles';
4
5
  import DSEmptyStates from '@synerise/ds-empty-states';
5
6
  import DSLoader from '@synerise/ds-loader';
6
7
  import Scrollbar from '@synerise/ds-scrollbar';
@@ -10,13 +11,13 @@ import { LIST_INNER_PADDING } from './constants';
10
11
  export var ListWrapper = styled.div.withConfig({
11
12
  displayName: "ItemPickerListstyles__ListWrapper",
12
13
  componentId: "sc-1r33ill-0"
13
- })(["position:relative;flex:1 0 calc(100% - ", "px);", " ", ""], function (props) {
14
+ })(["position:relative;flex:1 0 calc(100% - ", "px);", " ", " ", "{min-width:0;}"], function (props) {
14
15
  return props.offsetSpace;
15
16
  }, function (props) {
16
17
  return props.wrapperHeight !== undefined && "height: " + (props.wrapperHeight + LIST_INNER_PADDING) + "px;";
17
18
  }, function (props) {
18
19
  return props.centered && css(["display:flex;flex-direction:column;"]);
19
- });
20
+ }, DropdownBackActionLabel);
20
21
  export var ListContainer = styled(Dropdown.Wrapper).withConfig({
21
22
  displayName: "ItemPickerListstyles__ListContainer",
22
23
  componentId: "sc-1r33ill-1"
@@ -3,7 +3,9 @@ import type { ListItemProps } from '@synerise/ds-list-item';
3
3
  import type { ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
4
4
  import type { SearchBarProps } from '@synerise/ds-search-bar';
5
5
  import type { WithHTMLAttributes } from '@synerise/ds-utils';
6
- import type { ActionType, BaseItemType, BaseSectionType, BaseSectionTypeWithFolders, ContainerHeightType, ItemLoaderConfig, ItemsConfig, OnLoadedData } from '../ItemPickerNew/ItemPickerNew.types';
6
+ import type { ContainerHeightType, ItemLoaderConfig, ItemsConfig, OnLoadedData } from '../ItemPickerNew/ItemPickerNew.types';
7
+ import type { Action } from '../ItemPickerNew/types/actions.types';
8
+ import type { BaseItemType, BaseSectionType, BaseSectionTypeWithFolders } from '../ItemPickerNew/types/baseItemSectionType.types';
7
9
  type TextsAsReactNode = 'basicSearchPlaceholder' | 'searchPlaceholder' | 'refreshButtonLabel' | 'showMoreResultsLabel' | 'noItems' | 'noResults' | 'noResultsInSection' | 'searchAllFoldersButtonLabel' | 'recentsSectionLabel' | 'actionsSectionLabel' | 'resultsSectionLabel' | 'noActions' | 'itemsSectionLabel' | 'infiniteScrollLoadingMore' | 'infiniteScrollLoadingError' | 'errorMessageTitle' | 'errorMessageDetails' | 'backTooltip' | 'clearSearchTooltip' | 'infiniteScrollAllLoaded';
8
10
  export type ItemPickerListTexts = {
9
11
  [key in TextsAsReactNode]: ReactNode;
@@ -11,7 +13,7 @@ export type ItemPickerListTexts = {
11
13
  export type ItemSelectHandler<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = SectionType extends BaseSectionType ? (item: ItemType, section?: BaseSectionTypeWithFolders<BaseSectionType>) => void : (item: ItemType) => void;
12
14
  export type ItemPickerListProps<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = WithHTMLAttributes<HTMLDivElement, {
13
15
  recents?: ItemType[];
14
- actions?: ActionType[];
16
+ actions?: Action[];
15
17
  texts?: Partial<ItemPickerListTexts>;
16
18
  containerHeight?: ContainerHeightType;
17
19
  showItemsSectionLabel?: boolean;
@@ -20,7 +22,7 @@ export type ItemPickerListProps<ItemType extends BaseItemType, SectionType exten
20
22
  onItemSelect: ItemSelectHandler<ItemType, SectionType>;
21
23
  onSectionChange?: SectionType extends BaseSectionType ? (section?: BaseSectionTypeWithFolders<SectionType>) => void : undefined;
22
24
  selectedItem?: ItemType;
23
- getItemHeight?: (item: ItemType | SectionType | ActionType) => number;
25
+ getItemHeight?: (item: ItemType | SectionType | Action) => number;
24
26
  scrollbarProps?: ScrollbarAdditionalProps;
25
27
  searchBarProps?: Omit<SearchBarProps, 'value' | 'onSearchChange' | 'placeholder'>;
26
28
  onRefresh?: () => void;
@@ -4,8 +4,8 @@ type EmptyListMessageProps = {
4
4
  texts: Pick<ItemPickerListTexts, 'noResultsInSection' | 'noResults' | 'noItems' | 'noActions' | 'searchAllFoldersButtonLabel'>;
5
5
  hasCurrentSection?: boolean;
6
6
  listActions: boolean;
7
- isSearchSection: boolean;
7
+ isActionSection: boolean;
8
8
  buttonOnClick: () => void;
9
9
  };
10
- export declare const EmptyListMessage: ({ texts, listActions, isSearchSection, hasCurrentSection, buttonOnClick, }: EmptyListMessageProps) => React.JSX.Element;
10
+ export declare const EmptyListMessage: ({ texts, listActions, isActionSection, hasCurrentSection, buttonOnClick, }: EmptyListMessageProps) => React.JSX.Element;
11
11
  export {};
@@ -5,7 +5,7 @@ import * as S from '../ItemPickerList.styles';
5
5
  export var EmptyListMessage = function EmptyListMessage(_ref) {
6
6
  var texts = _ref.texts,
7
7
  listActions = _ref.listActions,
8
- isSearchSection = _ref.isSearchSection,
8
+ isActionSection = _ref.isActionSection,
9
9
  hasCurrentSection = _ref.hasCurrentSection,
10
10
  buttonOnClick = _ref.buttonOnClick;
11
11
  if (listActions) {
@@ -15,7 +15,7 @@ export var EmptyListMessage = function EmptyListMessage(_ref) {
15
15
  label: texts.noActions
16
16
  });
17
17
  }
18
- if (hasCurrentSection && !isSearchSection) {
18
+ if (hasCurrentSection && !isActionSection) {
19
19
  return /*#__PURE__*/React.createElement(S.EmptyStates, {
20
20
  customIcon: /*#__PURE__*/React.createElement(SearchNoResultsL, null),
21
21
  label: texts.noResultsInSection,
@@ -1,16 +1,17 @@
1
1
  import React, { type MutableRefObject } from 'react';
2
2
  import type { SearchBarProps } from '@synerise/ds-search-bar';
3
- import type { ItemPickerTexts, SearchActionType, SearchParamConfig } from '../../ItemPickerNew/ItemPickerNew.types';
3
+ import type { ItemPickerTexts } from '../../ItemPickerNew/ItemPickerNew.types';
4
+ import type { SearchByParamConfig } from '../../ItemPickerNew/types/actions.types';
4
5
  type ListSearchInputProps = {
5
- searchParamConfig?: SearchParamConfig;
6
- searchActionSection?: SearchActionType;
6
+ searchByParamConfig?: SearchByParamConfig;
7
7
  clearSearchQuery: () => void;
8
- setSearchParamConfig: (searchParamConfig: SearchParamConfig | undefined) => void;
8
+ setSearchByParamConfig: (searchByParamConfig: SearchByParamConfig | undefined) => void;
9
9
  debouncedChangeSearchQuery: (value: string) => void;
10
10
  inputRef: MutableRefObject<HTMLInputElement | null>;
11
11
  changeLocalSearchQueryRef: MutableRefObject<((value: string) => void) | null>;
12
12
  searchBarProps?: Omit<SearchBarProps, 'value' | 'onSearchChange' | 'placeholder'>;
13
13
  allTexts: ItemPickerTexts;
14
+ canPerformListActions: boolean;
14
15
  };
15
- export declare const ListSearchInput: ({ searchParamConfig, searchActionSection, changeLocalSearchQueryRef, clearSearchQuery, setSearchParamConfig, debouncedChangeSearchQuery, searchBarProps, allTexts, inputRef, }: ListSearchInputProps) => React.JSX.Element;
16
+ export declare const ListSearchInput: ({ searchByParamConfig, changeLocalSearchQueryRef, clearSearchQuery, setSearchByParamConfig, debouncedChangeSearchQuery, searchBarProps, allTexts, inputRef, canPerformListActions, }: ListSearchInputProps) => React.JSX.Element;
16
17
  export {};
@@ -8,20 +8,19 @@ var CLEAR_TOOLTIP_PROPS = {
8
8
  shortCuts: 'ESC'
9
9
  };
10
10
  export var ListSearchInput = function ListSearchInput(_ref) {
11
- var searchParamConfig = _ref.searchParamConfig,
12
- searchActionSection = _ref.searchActionSection,
11
+ var searchByParamConfig = _ref.searchByParamConfig,
13
12
  changeLocalSearchQueryRef = _ref.changeLocalSearchQueryRef,
14
13
  clearSearchQuery = _ref.clearSearchQuery,
15
- setSearchParamConfig = _ref.setSearchParamConfig,
14
+ setSearchByParamConfig = _ref.setSearchByParamConfig,
16
15
  debouncedChangeSearchQuery = _ref.debouncedChangeSearchQuery,
17
16
  searchBarProps = _ref.searchBarProps,
18
17
  allTexts = _ref.allTexts,
19
- inputRef = _ref.inputRef;
18
+ inputRef = _ref.inputRef,
19
+ canPerformListActions = _ref.canPerformListActions;
20
20
  var theme = useTheme();
21
21
  var _useState = useState(''),
22
22
  localSearchQuery = _useState[0],
23
23
  setLocalSearchQuery = _useState[1];
24
- var isSearchParamOrSearchSectionActive = Boolean(searchParamConfig || searchActionSection);
25
24
  var handleSearchChange = useCallback(function (value) {
26
25
  setLocalSearchQuery(value);
27
26
  debouncedChangeSearchQuery(value);
@@ -32,7 +31,7 @@ export var ListSearchInput = function ListSearchInput(_ref) {
32
31
  }, [inputRef]);
33
32
  var handleKeyDown = function handleKeyDown(event) {
34
33
  if (event.key === 'Backspace' && !localSearchQuery) {
35
- setSearchParamConfig(undefined);
34
+ setSearchByParamConfig(undefined);
36
35
  }
37
36
  };
38
37
  var handleClearInput = function handleClearInput() {
@@ -40,7 +39,7 @@ export var ListSearchInput = function ListSearchInput(_ref) {
40
39
  clearSearchQuery();
41
40
  return;
42
41
  }
43
- setSearchParamConfig(undefined);
42
+ setSearchByParamConfig(undefined);
44
43
  };
45
44
  useEffect(function () {
46
45
  var ref = changeLocalSearchQueryRef;
@@ -50,12 +49,12 @@ export var ListSearchInput = function ListSearchInput(_ref) {
50
49
  "data-testid": "search-wrapper"
51
50
  }, /*#__PURE__*/React.createElement(Dropdown.SearchInput, _extends({
52
51
  iconLeft: /*#__PURE__*/React.createElement(Icon, {
53
- component: (searchParamConfig == null ? void 0 : searchParamConfig.icon) || /*#__PURE__*/React.createElement(SearchM, null),
52
+ component: (searchByParamConfig == null ? void 0 : searchByParamConfig.icon) || /*#__PURE__*/React.createElement(SearchM, null),
54
53
  color: theme.palette['grey-600']
55
54
  }),
56
- placeholder: isSearchParamOrSearchSectionActive ? allTexts.basicSearchPlaceholder : allTexts.searchPlaceholder
55
+ placeholder: canPerformListActions ? allTexts.searchPlaceholder : allTexts.basicSearchPlaceholder
57
56
  }, searchBarProps, {
58
- valuePrefix: searchParamConfig == null ? void 0 : searchParamConfig.paramKeyLabel,
57
+ valuePrefix: searchByParamConfig == null ? void 0 : searchByParamConfig.paramKeyLabel,
59
58
  onKeyDown: handleKeyDown,
60
59
  clearTooltip: allTexts.clearSearchTooltip,
61
60
  clearTooltipProps: CLEAR_TOOLTIP_PROPS,
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties } from 'react';
2
- import type { BaseItemType } from '../ItemPickerNew/ItemPickerNew.types';
2
+ import type { BaseItemType } from '../ItemPickerNew/types/baseItemSectionType.types';
3
3
  export declare const LIST_STYLE: CSSProperties;
4
4
  export declare const ITEM_SIZE: {
5
5
  large: number;
@@ -14,6 +14,7 @@ export declare const SEARCH_BAR_HEIGHT = 53;
14
14
  export declare const FOOTER_HEIGHT = 48;
15
15
  export declare const LIST_INNER_PADDING = 8;
16
16
  export declare const FIRST_PAGE = 0;
17
+ export declare const SECOND_PAGE = 1;
17
18
  export declare const ITEMS_PER_PAGE = 150;
18
19
  export declare const ITEMS_PER_SECTION = 4;
19
20
  export declare const ITEMS_PER_SECTION_IN_SEARCH = 4;
@@ -13,6 +13,7 @@ export var SEARCH_BAR_HEIGHT = 53;
13
13
  export var FOOTER_HEIGHT = 48;
14
14
  export var LIST_INNER_PADDING = 8;
15
15
  export var FIRST_PAGE = 0;
16
+ export var SECOND_PAGE = 1;
16
17
  export var ITEMS_PER_PAGE = 150;
17
18
  export var ITEMS_PER_SECTION = 4;
18
19
  export var ITEMS_PER_SECTION_IN_SEARCH = 4;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { BaseSectionType, BaseSectionTypeWithFolders } from '../../ItemPickerNew/ItemPickerNew.types';
2
+ import type { BaseSectionType, BaseSectionTypeWithFolders } from '../../ItemPickerNew/types/baseItemSectionType.types';
3
3
  type NestedFoldersProps<SectionType extends BaseSectionType | undefined> = {
4
4
  currentSection?: SectionType extends BaseSectionType ? BaseSectionTypeWithFolders<SectionType> : undefined;
5
5
  sections?: SectionType extends BaseSectionType ? BaseSectionTypeWithFolders<SectionType>[] : undefined;
@@ -11,7 +11,7 @@ export declare const useFlattenFolders: <SectionType extends BaseSectionType | u
11
11
  id: string;
12
12
  selected?: boolean | undefined;
13
13
  highlight?: string | undefined;
14
- hoverTooltipProps?: (import("rc-trigger").TriggerProps & {
14
+ hoverTooltipProps?: (Pick<import("rc-trigger").TriggerProps, "mouseEnterDelay" | "mouseLeaveDelay" | "getPopupContainer" | "onPopupVisibleChange" | "onPopupClick" | "defaultPopupVisible" | "action" | "afterPopupVisibleChange" | "popupPlacement" | "forceRender"> & {
15
15
  ref?: import("react").LegacyRef<import("@synerise/ds-list-item/dist/ListItem.types").TriggerHandle> | undefined;
16
16
  }) | undefined;
17
17
  prefixel?: ReactNode | import("@synerise/ds-list-item/dist/ListItem.types").AddonRenderer;
@@ -20,18 +20,7 @@ export declare const useFlattenFolders: <SectionType extends BaseSectionType | u
20
20
  text: string;
21
21
  folders?: BaseSectionTypeWithFolders<BaseSectionType>[] | undefined;
22
22
  }[] | undefined;
23
- childFolders: ({
24
- type?: import("@synerise/ds-list-item").ItemType | undefined;
25
- id?: string | undefined;
26
- selected?: boolean | undefined;
27
- highlight?: string | undefined;
28
- hoverTooltipProps?: (import("rc-trigger").TriggerProps & {
29
- ref?: import("react").LegacyRef<import("@synerise/ds-list-item/dist/ListItem.types").TriggerHandle> | undefined;
30
- }) | undefined;
31
- prefixel?: ReactNode | import("@synerise/ds-list-item/dist/ListItem.types").AddonRenderer;
32
- renderHoverTooltip?: (() => JSX.Element) | undefined;
33
- timeToHideTooltip?: number | undefined;
34
- } & {
23
+ childFolders: (import("../../ItemPickerNew/types/baseItemSectionType.types").InheritedFromListItem & {
35
24
  text: string;
36
25
  id: string | number;
37
26
  } & {
@@ -40,18 +29,7 @@ export declare const useFlattenFolders: <SectionType extends BaseSectionType | u
40
29
  titles?: ReactNode[] | undefined;
41
30
  })[] | undefined;
42
31
  parentFolder: BaseSectionTypeWithFolders<BaseSectionType> | undefined;
43
- currentFolders: ({
44
- type?: import("@synerise/ds-list-item").ItemType | undefined;
45
- id?: string | undefined;
46
- selected?: boolean | undefined;
47
- highlight?: string | undefined;
48
- hoverTooltipProps?: (import("rc-trigger").TriggerProps & {
49
- ref?: import("react").LegacyRef<import("@synerise/ds-list-item/dist/ListItem.types").TriggerHandle> | undefined;
50
- }) | undefined;
51
- prefixel?: ReactNode | import("@synerise/ds-list-item/dist/ListItem.types").AddonRenderer;
52
- renderHoverTooltip?: (() => JSX.Element) | undefined;
53
- timeToHideTooltip?: number | undefined;
54
- } & {
32
+ currentFolders: (import("../../ItemPickerNew/types/baseItemSectionType.types").InheritedFromListItem & {
55
33
  text: string;
56
34
  id: string | number;
57
35
  } & {
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- import type { BaseItemType, BaseSectionType, BaseSectionTypeWithFolders, OnLoadedData, SearchActionType, SearchParamConfig } from '../../ItemPickerNew/ItemPickerNew.types';
2
+ import type { OnLoadedData } from '../../ItemPickerNew/ItemPickerNew.types';
3
+ import type { SearchByAction, SearchByParamConfig, SearchInAction } from '../../ItemPickerNew/types/actions.types';
4
+ import type { BaseItemType, BaseSectionType, BaseSectionTypeWithFolders } from '../../ItemPickerNew/types/baseItemSectionType.types';
3
5
  import type { ItemPickerListProps, ItemPickerListTexts } from '../ItemPickerList.types';
4
6
  type ItemsInSectionsType<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = {
5
7
  items: ItemPickerListProps<ItemType, SectionType>['items'];
@@ -22,7 +24,7 @@ export declare const useItemsInSections: <ItemType extends BaseItemType, Section
22
24
  goBack: () => void;
23
25
  resetCurrentSection: () => void;
24
26
  setCurrentSection: (section?: BaseSectionType | SectionType | undefined) => void;
25
- mergedItemsList: NonNullable<import("@synerise/ds-list-item").ListItemProps | import("../ItemPickerList.types").TitleListItemProps | undefined>[];
27
+ mergedItemsList: (import("@synerise/ds-list-item").ListItemProps | import("../ItemPickerList.types").TitleListItemProps)[];
26
28
  isLoading: boolean;
27
29
  isLoadingMore: boolean;
28
30
  isLoadedAll: boolean;
@@ -32,9 +34,12 @@ export declare const useItemsInSections: <ItemType extends BaseItemType, Section
32
34
  isLoadingMoreError: boolean;
33
35
  contentHeight: number | undefined;
34
36
  refreshEnabled: boolean;
35
- searchActionSection: SearchActionType | undefined;
36
- searchParamConfig: SearchParamConfig | undefined;
37
- setSearchParamConfig: import("react").Dispatch<import("react").SetStateAction<SearchParamConfig | undefined>>;
37
+ searchByAction: SearchByAction | undefined;
38
+ searchByParamConfig: SearchByParamConfig | undefined;
39
+ setSearchByParamConfig: import("react").Dispatch<import("react").SetStateAction<SearchByParamConfig | undefined>>;
38
40
  listActions: boolean;
41
+ searchInItem: ItemType | undefined;
42
+ searchInAction: SearchInAction | undefined;
43
+ canPerformListActions: boolean;
39
44
  };
40
45
  export {};