@synerise/ds-item-picker 1.9.6 → 1.9.7
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 +8 -0
- package/dist/components/ItemPickerList/ItemPickerList.d.ts +1 -1
- package/dist/components/ItemPickerList/ItemPickerList.types.d.ts +1 -37
- package/dist/components/ItemPickerList/components/EmptyListMessage.d.ts +1 -1
- package/dist/components/ItemPickerList/components/ErrorMessage.d.ts +1 -1
- package/dist/components/ItemPickerList/components/InfiniteLoaderItem.d.ts +1 -1
- package/dist/components/ItemPickerList/components/ItemPickerListFooter.d.ts +1 -1
- package/dist/components/ItemPickerList/components/ItemPickerListRow.d.ts +2 -1
- package/dist/components/ItemPickerList/hooks/useItemsInSections.d.ts +1 -2
- package/dist/components/ItemPickerList/hooks/useItemsInSections.utils.d.ts +2 -1
- package/dist/components/ItemPickerList/utils/actionItemsUtils.d.ts +1 -1
- package/dist/components/ItemPickerNew/ItemPickerNew.types.d.ts +35 -3
- package/dist/index.d.ts +2 -2
- package/package.json +23 -22
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.9.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-item-picker@1.9.6...@synerise/ds-item-picker@1.9.7) (2025-09-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-item-picker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.9.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-item-picker@1.9.5...@synerise/ds-item-picker@1.9.6) (2025-09-05)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-item-picker
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type ItemPickerListProps } from '../ItemPickerNew/ItemPickerNew.types';
|
|
2
3
|
import type { BaseItemType, BaseSectionType } from '../ItemPickerNew/types/baseItemSectionType.types';
|
|
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, isDropdown, ...htmlAttributes }: ItemPickerListProps<ItemType, SectionType>) => React.JSX.Element;
|
|
5
5
|
export default ItemPickerList;
|
|
@@ -1,42 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ListItemProps } from '@synerise/ds-list-item';
|
|
3
|
-
import type { ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
|
|
4
|
-
import type { SearchBarProps } from '@synerise/ds-search-bar';
|
|
5
|
-
import type { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
6
|
-
import type { ContainerHeightType, ItemLoaderConfig, ItemsConfig, OnLoadedData } from '../ItemPickerNew/ItemPickerNew.types';
|
|
7
|
-
import type { Action } from '../ItemPickerNew/types/actions.types';
|
|
1
|
+
import { type ListItemProps } from '@synerise/ds-list-item';
|
|
8
2
|
import type { BaseItemType, BaseSectionType, BaseSectionTypeWithFolders } from '../ItemPickerNew/types/baseItemSectionType.types';
|
|
9
|
-
type TextsAsReactNode = 'basicSearchPlaceholder' | 'searchPlaceholder' | 'refreshButtonLabel' | 'showMoreResultsLabel' | 'noItems' | 'noResults' | 'noResultsInSection' | 'searchAllFoldersButtonLabel' | 'recentsSectionLabel' | 'actionsSectionLabel' | 'resultsSectionLabel' | 'noActions' | 'itemsSectionLabel' | 'infiniteScrollLoadingMore' | 'infiniteScrollLoadingError' | 'errorMessageTitle' | 'errorMessageDetails' | 'backTooltip' | 'clearSearchTooltip' | 'infiniteScrollAllLoaded';
|
|
10
|
-
export type ItemPickerListTexts = {
|
|
11
|
-
[key in TextsAsReactNode]: ReactNode;
|
|
12
|
-
};
|
|
13
3
|
export type ItemSelectHandler<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = SectionType extends BaseSectionType ? (item: ItemType, section?: BaseSectionTypeWithFolders<BaseSectionType>) => void : (item: ItemType) => void;
|
|
14
|
-
export type ItemPickerListProps<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = WithHTMLAttributes<HTMLDivElement, {
|
|
15
|
-
recents?: ItemType[];
|
|
16
|
-
actions?: Action[];
|
|
17
|
-
texts?: Partial<ItemPickerListTexts>;
|
|
18
|
-
containerHeight?: ContainerHeightType;
|
|
19
|
-
showItemsSectionLabel?: boolean;
|
|
20
|
-
noResultsIcon?: ReactNode;
|
|
21
|
-
emptyListIcon?: ReactNode;
|
|
22
|
-
onItemSelect: ItemSelectHandler<ItemType, SectionType>;
|
|
23
|
-
onSectionChange?: SectionType extends BaseSectionType ? (section?: BaseSectionTypeWithFolders<SectionType>) => void : undefined;
|
|
24
|
-
selectedItem?: ItemType;
|
|
25
|
-
getItemHeight?: (item: ItemType | SectionType | Action) => number;
|
|
26
|
-
scrollbarProps?: ScrollbarAdditionalProps;
|
|
27
|
-
searchBarProps?: Omit<SearchBarProps, 'value' | 'onSearchChange' | 'placeholder'>;
|
|
28
|
-
onRefresh?: () => void;
|
|
29
|
-
items: ItemType[] | ItemsConfig<ItemType> | ItemLoaderConfig<ItemType>;
|
|
30
|
-
isLoading?: boolean;
|
|
31
|
-
isVisible?: boolean;
|
|
32
|
-
sections?: SectionType extends BaseSectionType ? BaseSectionTypeWithFolders<SectionType>[] : undefined;
|
|
33
|
-
containerRef?: Ref<HTMLDivElement>;
|
|
34
|
-
includeSearchBar?: boolean;
|
|
35
|
-
includeFooter?: boolean;
|
|
36
|
-
onLoadedData?: OnLoadedData;
|
|
37
|
-
isDropdown?: boolean;
|
|
38
|
-
}>;
|
|
39
4
|
export type TitleListItemProps = Omit<ListItemProps, 'type'> & {
|
|
40
5
|
type: 'title';
|
|
41
6
|
};
|
|
42
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ItemPickerListTexts } from '
|
|
2
|
+
import { type ItemPickerListTexts } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
3
3
|
type EmptyListMessageProps = {
|
|
4
4
|
texts: Pick<ItemPickerListTexts, 'noResultsInSection' | 'noResults' | 'noItems' | 'noActions' | 'searchAllFoldersButtonLabel'>;
|
|
5
5
|
hasCurrentSection?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ButtonProps } from '@synerise/ds-button';
|
|
3
|
-
import { type ItemPickerListTexts } from '
|
|
3
|
+
import { type ItemPickerListTexts } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
4
4
|
type ItemPickerListFooterProps = {
|
|
5
5
|
texts: ItemPickerListTexts;
|
|
6
6
|
refreshButtonProps?: Partial<ButtonProps>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { type CSSProperties, type PropsWithChildren } from 'react';
|
|
2
2
|
import { type ListItemProps } from '@synerise/ds-list-item';
|
|
3
|
-
import { type ItemPickerListTexts
|
|
3
|
+
import { type ItemPickerListTexts } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
4
|
+
import { type TitleListItemProps } from '../ItemPickerList.types';
|
|
4
5
|
export type ItemPickerListRowProps = {
|
|
5
6
|
index: number;
|
|
6
7
|
style: CSSProperties;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { OnLoadedData } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
1
|
+
import type { ItemPickerListProps, ItemPickerListTexts, OnLoadedData } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
2
2
|
import type { SearchByAction, SearchByParamConfig, SearchInAction } from '../../ItemPickerNew/types/actions.types';
|
|
3
3
|
import type { BaseItemType, BaseSectionType, BaseSectionTypeWithFolders } from '../../ItemPickerNew/types/baseItemSectionType.types';
|
|
4
|
-
import type { ItemPickerListProps, ItemPickerListTexts } from '../ItemPickerList.types';
|
|
5
4
|
type ItemsInSectionsType<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = {
|
|
6
5
|
items: ItemPickerListProps<ItemType, SectionType>['items'];
|
|
7
6
|
texts: ItemPickerListTexts;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ListItemProps } from '@synerise/ds-list-item';
|
|
3
|
+
import { type ItemPickerListTexts } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
3
4
|
import { type BaseItemType, type BaseSectionType, type BaseSectionTypeWithFolders } from '../../ItemPickerNew/types/baseItemSectionType.types';
|
|
4
|
-
import { type
|
|
5
|
+
import { type TitleListItemProps } from '../ItemPickerList.types';
|
|
5
6
|
export declare const getFolderItem: (item: ListItemProps, onClick: ListItemProps["onClick"]) => ListItemProps;
|
|
6
7
|
export declare const getShowMoreItem: (label: ReactNode, onClick: ListItemProps["onClick"]) => ListItemProps;
|
|
7
8
|
export declare const getTitleItem: (titleText: ReactNode) => TitleListItemProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ListItemProps } from '@synerise/ds-list-item';
|
|
2
|
+
import { type ItemPickerListTexts } from '../../ItemPickerNew/ItemPickerNew.types';
|
|
2
3
|
import { type Action, type SearchByAction, type SearchByParamConfig, type SearchInAction } from '../../ItemPickerNew/types/actions.types';
|
|
3
|
-
import { type ItemPickerListTexts } from '../ItemPickerList.types';
|
|
4
4
|
export declare const getActionItem: (action: Action & {
|
|
5
5
|
onClick?: (action: Action) => void;
|
|
6
6
|
}, searchQuery?: string) => ListItemProps;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ItemSelectHandler } from 'components/ItemPickerList/ItemPickerList.types';
|
|
2
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
3
|
import type { DropdownProps } from '@synerise/ds-dropdown';
|
|
3
4
|
import type { FormFieldCommonProps } from '@synerise/ds-form-field';
|
|
4
5
|
import type { InformationCardTooltipProps } from '@synerise/ds-information-card';
|
|
6
|
+
import { type ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
|
|
7
|
+
import { type SearchBarProps } from '@synerise/ds-search-bar';
|
|
5
8
|
import type { WithHTMLAttributes } from '@synerise/ds-utils';
|
|
6
|
-
import type { ItemPickerListProps, ItemPickerListTexts } from '../ItemPickerList/ItemPickerList.types';
|
|
7
9
|
import type { RenderMode } from '../ItemPickerList/types/renderMode';
|
|
8
10
|
import type { ItemPickerTriggerProps, ItemPickerTriggerTexts } from '../ItemPickerTrigger/Trigger.types';
|
|
9
|
-
import
|
|
11
|
+
import { type Action } from './types/actions.types';
|
|
12
|
+
import type { BaseItemType, BaseSectionType, BaseSectionTypeWithFolders } from './types/baseItemSectionType.types';
|
|
10
13
|
type HeightConfig = {
|
|
11
14
|
defaultHeight: number;
|
|
12
15
|
viewportHeightThreshold?: number;
|
|
@@ -65,4 +68,33 @@ export type ItemPickerProps<ItemType extends BaseItemType, SectionType extends B
|
|
|
65
68
|
onLoadedData?: OnLoadedData;
|
|
66
69
|
dropdownProps?: Partial<DropdownProps>;
|
|
67
70
|
} & Pick<ItemPickerListProps<ItemType, SectionType>, 'items' | 'actions' | 'recents' | 'sections' | 'isLoading' | 'onRefresh' | 'onSectionChange' | 'containerHeight' | 'showItemsSectionLabel' | 'noResultsIcon' | 'emptyListIcon' | 'selectedItem' | 'getItemHeight' | 'scrollbarProps' | 'searchBarProps' | 'includeFooter' | 'includeSearchBar'>> & FormFieldCommonProps & Partial<Pick<ItemPickerTriggerProps, 'placeholder' | 'placeholderIcon' | 'onClear'>>;
|
|
71
|
+
export type TextsAsReactNode = 'basicSearchPlaceholder' | 'searchPlaceholder' | 'refreshButtonLabel' | 'showMoreResultsLabel' | 'noItems' | 'noResults' | 'noResultsInSection' | 'searchAllFoldersButtonLabel' | 'recentsSectionLabel' | 'actionsSectionLabel' | 'resultsSectionLabel' | 'noActions' | 'itemsSectionLabel' | 'infiniteScrollLoadingMore' | 'infiniteScrollLoadingError' | 'errorMessageTitle' | 'errorMessageDetails' | 'backTooltip' | 'clearSearchTooltip' | 'infiniteScrollAllLoaded';
|
|
72
|
+
export type ItemPickerListTexts = {
|
|
73
|
+
[key in TextsAsReactNode]: ReactNode;
|
|
74
|
+
};
|
|
75
|
+
export type ItemPickerListProps<ItemType extends BaseItemType, SectionType extends BaseSectionType | undefined> = WithHTMLAttributes<HTMLDivElement, {
|
|
76
|
+
recents?: ItemType[];
|
|
77
|
+
actions?: Action[];
|
|
78
|
+
texts?: Partial<ItemPickerListTexts>;
|
|
79
|
+
containerHeight?: ContainerHeightType;
|
|
80
|
+
showItemsSectionLabel?: boolean;
|
|
81
|
+
noResultsIcon?: ReactNode;
|
|
82
|
+
emptyListIcon?: ReactNode;
|
|
83
|
+
onItemSelect: ItemSelectHandler<ItemType, SectionType>;
|
|
84
|
+
onSectionChange?: SectionType extends BaseSectionType ? (section?: BaseSectionTypeWithFolders<SectionType>) => void : undefined;
|
|
85
|
+
selectedItem?: ItemType;
|
|
86
|
+
getItemHeight?: (item: ItemType | SectionType | Action) => number;
|
|
87
|
+
scrollbarProps?: ScrollbarAdditionalProps;
|
|
88
|
+
searchBarProps?: Omit<SearchBarProps, 'value' | 'onSearchChange' | 'placeholder'>;
|
|
89
|
+
onRefresh?: () => void;
|
|
90
|
+
items: ItemType[] | ItemsConfig<ItemType> | ItemLoaderConfig<ItemType>;
|
|
91
|
+
isLoading?: boolean;
|
|
92
|
+
isVisible?: boolean;
|
|
93
|
+
sections?: SectionType extends BaseSectionType ? BaseSectionTypeWithFolders<SectionType>[] : undefined;
|
|
94
|
+
containerRef?: Ref<HTMLDivElement>;
|
|
95
|
+
includeSearchBar?: boolean;
|
|
96
|
+
includeFooter?: boolean;
|
|
97
|
+
onLoadedData?: OnLoadedData;
|
|
98
|
+
isDropdown?: boolean;
|
|
99
|
+
}>;
|
|
68
100
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { default as ItemPickerLegacy } from './components/ItemPickerLegacy/ItemP
|
|
|
4
4
|
export { default as ItemPickerTrigger } from './components/ItemPickerTrigger/Trigger';
|
|
5
5
|
export { ItemPickerList } from './components/ItemPickerList/ItemPickerList';
|
|
6
6
|
export { ItemPickerNew } from './components/ItemPickerNew/ItemPickerNew';
|
|
7
|
-
export type {
|
|
8
|
-
export type { ItemPickerProps as ItemPickerPropsNew, ItemLoaderConfig, ItemLoaderResponse, LoaderProps, OnLoadedData, } from './components/ItemPickerNew/ItemPickerNew.types';
|
|
7
|
+
export type { ItemSelectHandler } from './components/ItemPickerList/ItemPickerList.types';
|
|
8
|
+
export type { ItemPickerProps as ItemPickerPropsNew, ItemLoaderConfig, ItemLoaderResponse, LoaderProps, OnLoadedData, ItemPickerListProps, ItemPickerListTexts, } from './components/ItemPickerNew/ItemPickerNew.types';
|
|
9
9
|
export type { BaseSectionTypeWithFolders, BaseItemType, } from './components/ItemPickerNew/types/baseItemSectionType.types';
|
|
10
10
|
export type { Action } from './components/ItemPickerNew/types/actions.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-item-picker",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.7",
|
|
4
4
|
"description": "ItemPicker UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"test": "jest",
|
|
27
27
|
"test:watch": "npm run test -- --watchAll",
|
|
28
28
|
"types": "tsc --noEmit",
|
|
29
|
+
"check:circular-dependencies": "madge --circular ./src --extensions ts,tsx,js,jsx --ts-config tsconfig.json --exclude '/dist/'",
|
|
29
30
|
"upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
|
|
30
31
|
},
|
|
31
32
|
"sideEffects": [
|
|
@@ -34,26 +35,26 @@
|
|
|
34
35
|
],
|
|
35
36
|
"types": "dist/index.d.ts",
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-alert": "^1.1.
|
|
38
|
-
"@synerise/ds-avatar": "^1.0.
|
|
39
|
-
"@synerise/ds-button": "^1.4.
|
|
40
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
41
|
-
"@synerise/ds-empty-states": "^1.0.
|
|
42
|
-
"@synerise/ds-flag": "^1.0.
|
|
43
|
-
"@synerise/ds-form-field": "^1.1.
|
|
44
|
-
"@synerise/ds-icon": "^1.7.
|
|
45
|
-
"@synerise/ds-information-card": "^1.0.
|
|
46
|
-
"@synerise/ds-list-item": "^1.0.
|
|
47
|
-
"@synerise/ds-loader": "^1.0.
|
|
48
|
-
"@synerise/ds-popconfirm": "^1.0.
|
|
49
|
-
"@synerise/ds-result": "^1.0.
|
|
50
|
-
"@synerise/ds-scrollbar": "^1.1.
|
|
51
|
-
"@synerise/ds-search": "^1.3.
|
|
52
|
-
"@synerise/ds-search-bar": "^1.3.
|
|
53
|
-
"@synerise/ds-short-cuts": "^1.0.
|
|
54
|
-
"@synerise/ds-skeleton": "^1.0.
|
|
55
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
56
|
-
"@synerise/ds-utils": "^1.4.
|
|
38
|
+
"@synerise/ds-alert": "^1.1.17",
|
|
39
|
+
"@synerise/ds-avatar": "^1.0.21",
|
|
40
|
+
"@synerise/ds-button": "^1.4.10",
|
|
41
|
+
"@synerise/ds-dropdown": "^1.0.22",
|
|
42
|
+
"@synerise/ds-empty-states": "^1.0.18",
|
|
43
|
+
"@synerise/ds-flag": "^1.0.4",
|
|
44
|
+
"@synerise/ds-form-field": "^1.1.15",
|
|
45
|
+
"@synerise/ds-icon": "^1.7.2",
|
|
46
|
+
"@synerise/ds-information-card": "^1.0.30",
|
|
47
|
+
"@synerise/ds-list-item": "^1.0.20",
|
|
48
|
+
"@synerise/ds-loader": "^1.0.9",
|
|
49
|
+
"@synerise/ds-popconfirm": "^1.0.22",
|
|
50
|
+
"@synerise/ds-result": "^1.0.23",
|
|
51
|
+
"@synerise/ds-scrollbar": "^1.1.8",
|
|
52
|
+
"@synerise/ds-search": "^1.3.1",
|
|
53
|
+
"@synerise/ds-search-bar": "^1.3.11",
|
|
54
|
+
"@synerise/ds-short-cuts": "^1.0.20",
|
|
55
|
+
"@synerise/ds-skeleton": "^1.0.21",
|
|
56
|
+
"@synerise/ds-tooltip": "^1.1.18",
|
|
57
|
+
"@synerise/ds-utils": "^1.4.2",
|
|
57
58
|
"lodash": "^4.17.21",
|
|
58
59
|
"react-window": "^1.8.11",
|
|
59
60
|
"uuid": "^8.3.2"
|
|
@@ -64,5 +65,5 @@
|
|
|
64
65
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
65
66
|
"styled-components": "^5.3.3"
|
|
66
67
|
},
|
|
67
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "5beb6ab5f2d77b9e98e04caab7dff20b8436078b"
|
|
68
69
|
}
|