@synerise/ds-items-roll 1.0.20 → 1.0.22
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 +19 -0
- package/dist/ItemsRoll.d.ts +1 -1
- package/dist/ItemsRoll.js +2 -8
- package/dist/ItemsRoll.styles.d.ts +4 -5
- package/dist/ItemsRoll.styles.js +3 -6
- package/dist/ItemsRoll.types.d.ts +3 -0
- package/dist/ItemsRollComponents/List.d.ts +1 -1
- package/dist/ItemsRollComponents/List.js +5 -25
- package/dist/ItemsRollComponents/ListItem.styles.d.ts +1 -2
- package/package.json +12 -13
- package/dist/ItemsRollComponents/VirtualizedListItem.d.ts +0 -5
- package/dist/ItemsRollComponents/VirtualizedListItem.js +0 -38
- package/dist/ItemsRollComponents/VirtualizedListItem.types.d.ts +0 -9
- package/dist/ItemsRollComponents/VirtualizedListItem.types.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.0.22](https://github.com/Synerise/synerise-design/compare/@synerise/ds-items-roll@1.0.21...@synerise/ds-items-roll@1.0.22) (2025-07-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-items-roll
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.0.21](https://github.com/Synerise/synerise-design/compare/@synerise/ds-items-roll@1.0.20...@synerise/ds-items-roll@1.0.21) (2025-07-17)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **items-roll:** change icons and add new stories ([c813c6f](https://github.com/Synerise/synerise-design/commit/c813c6f10d2a5b107a534f7abfd54765a6e5e7a7))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.0.20](https://github.com/Synerise/synerise-design/compare/@synerise/ds-items-roll@1.0.19...@synerise/ds-items-roll@1.0.20) (2025-07-15)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-items-roll
|
package/dist/ItemsRoll.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ItemsRollProps } from './ItemsRoll.types';
|
|
3
|
-
export declare const ItemsRoll: ({ actions, changeSelectionIcon, changeSelectionDropdownProps, className, customSidebarActions, groups, hideSearch, isDisabled, items, maxToShowItems, onClearAll, onChangeSelection, onItemClick, onItemRemove, onSearchClear, onSearch, renderCount, searchValue, searchPlaceholder, showMoreStep, style, texts, useFooter,
|
|
3
|
+
export declare const ItemsRoll: ({ actions, changeSelectionIcon, changeSelectionDropdownProps, className, customSidebarActions, groups, hideSearch, isDisabled, items, maxToShowItems, onClearAll, onChangeSelection, onItemClick, onItemRemove, onSearchClear, onSearch, renderCount, searchValue, searchPlaceholder, showMoreStep, style, texts, useFooter, }: ItemsRollProps) => React.JSX.Element;
|
|
4
4
|
export default ItemsRoll;
|
package/dist/ItemsRoll.js
CHANGED
|
@@ -28,10 +28,7 @@ export var ItemsRoll = function ItemsRoll(_ref) {
|
|
|
28
28
|
showMoreStep = _ref$showMoreStep === void 0 ? 10 : _ref$showMoreStep,
|
|
29
29
|
style = _ref.style,
|
|
30
30
|
texts = _ref.texts,
|
|
31
|
-
useFooter = _ref.useFooter
|
|
32
|
-
useVirtualizedList = _ref.useVirtualizedList,
|
|
33
|
-
virtualizedRowWidth = _ref.virtualizedRowWidth,
|
|
34
|
-
virtualizedRowHeight = _ref.virtualizedRowHeight;
|
|
31
|
+
useFooter = _ref.useFooter;
|
|
35
32
|
var intl = useIntl();
|
|
36
33
|
var defaultTexts = {
|
|
37
34
|
changeSelectionLabel: intl.formatMessage({
|
|
@@ -121,10 +118,7 @@ export var ItemsRoll = function ItemsRoll(_ref) {
|
|
|
121
118
|
noResultsLabel: allTexts.noResultsLabel,
|
|
122
119
|
removeTooltipLabel: allTexts.removeTooltipLabel,
|
|
123
120
|
searchValue: searchValue,
|
|
124
|
-
|
|
125
|
-
visibleItems: visibleItems,
|
|
126
|
-
virtualizedRowHeight: virtualizedRowHeight,
|
|
127
|
-
virtualizedRowWidth: virtualizedRowWidth
|
|
121
|
+
visibleItems: visibleItems
|
|
128
122
|
}), useFooter && /*#__PURE__*/React.createElement(Footer, {
|
|
129
123
|
searchMode: Boolean(searchValue),
|
|
130
124
|
allTexts: allTexts,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import Button from '@synerise/ds-button';
|
|
3
2
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
3
|
export declare const ContainerSpaceBetween: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -12,10 +11,10 @@ export declare const SearchWrapper: import("styled-components").StyledComponent<
|
|
|
12
11
|
export declare const ShowButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
|
|
13
12
|
export declare const ShowButtonLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
14
13
|
export declare const ClearButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
|
|
15
|
-
export declare const ArrowIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) =>
|
|
14
|
+
export declare const ArrowIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => React.JSX.Element, any, {}, never>;
|
|
16
15
|
export declare const NoResults: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
16
|
export declare const NoResultIconWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
|
-
export declare const Divider: import("styled-components").StyledComponent<(props: import("@synerise/ds-divider").DividerProps) =>
|
|
19
|
-
footer?: boolean
|
|
17
|
+
export declare const Divider: import("styled-components").StyledComponent<(props: import("@synerise/ds-divider").DividerProps) => React.JSX.Element, any, {
|
|
18
|
+
footer?: boolean;
|
|
20
19
|
}, never>;
|
|
21
|
-
export declare const WarningIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) =>
|
|
20
|
+
export declare const WarningIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => React.JSX.Element, any, {}, never>;
|
package/dist/ItemsRoll.styles.js
CHANGED
|
@@ -103,11 +103,8 @@ export var NoResults = styled.div.withConfig({
|
|
|
103
103
|
export var NoResultIconWrapper = styled.div.withConfig({
|
|
104
104
|
displayName: "ItemsRollstyles__NoResultIconWrapper",
|
|
105
105
|
componentId: "sc-579u47-14"
|
|
106
|
-
})(["width:40px;height:40px;border-radius:50%;
|
|
106
|
+
})(["width:40px;height:40px;border-radius:50%;margin-bottom:16px;display:flex;align-items:center;justify-content:center;.ds-icon{svg{fill:", ";}}"], function (_ref15) {
|
|
107
107
|
var theme = _ref15.theme;
|
|
108
|
-
return theme.palette['grey-200'];
|
|
109
|
-
}, function (_ref16) {
|
|
110
|
-
var theme = _ref16.theme;
|
|
111
108
|
return theme.palette['grey-600'];
|
|
112
109
|
});
|
|
113
110
|
export var Divider = styled(DividerBase).withConfig({
|
|
@@ -119,7 +116,7 @@ export var Divider = styled(DividerBase).withConfig({
|
|
|
119
116
|
export var WarningIcon = styled(Icon).withConfig({
|
|
120
117
|
displayName: "ItemsRollstyles__WarningIcon",
|
|
121
118
|
componentId: "sc-579u47-16"
|
|
122
|
-
})(["svg{fill:", ";}"], function (
|
|
123
|
-
var theme =
|
|
119
|
+
})(["svg{fill:", ";}"], function (_ref16) {
|
|
120
|
+
var theme = _ref16.theme;
|
|
124
121
|
return theme.palette['yellow-500'];
|
|
125
122
|
});
|
|
@@ -36,7 +36,10 @@ export type ItemsRollProps = {
|
|
|
36
36
|
[k in Texts]?: ReactNode;
|
|
37
37
|
};
|
|
38
38
|
useFooter?: boolean;
|
|
39
|
+
/** @deprecated */
|
|
39
40
|
useVirtualizedList?: boolean;
|
|
41
|
+
/** @deprecated */
|
|
40
42
|
virtualizedRowHeight?: number;
|
|
43
|
+
/** @deprecated */
|
|
41
44
|
virtualizedRowWidth?: number;
|
|
42
45
|
};
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { type ItemRollElement } from '../ItemsRoll.types';
|
|
3
3
|
import { type ListProps } from './List.types';
|
|
4
4
|
export declare const itemsInGroup: (group: string, items: ItemRollElement[]) => ItemRollElement[];
|
|
5
|
-
declare const List: ({ groups,
|
|
5
|
+
declare const List: ({ groups, onItemClick, onItemRemove, noResultsLabel, removeTooltipLabel, searchValue, visibleItems, }: ListProps) => React.JSX.Element;
|
|
6
6
|
export default List;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import Icon, { SearchNoResultsM } from '@synerise/ds-icon';
|
|
2
|
+
import Icon, { InformationNoSearchResultL } from '@synerise/ds-icon';
|
|
4
3
|
import { GroupItem } from '@synerise/ds-list-item';
|
|
5
4
|
import * as S from '../ItemsRoll.styles';
|
|
6
5
|
import ItemElement from './ListItem';
|
|
7
|
-
import ItemRenderer from './VirtualizedListItem';
|
|
8
6
|
export var itemsInGroup = function itemsInGroup(group, items) {
|
|
9
7
|
return items.filter(function (item) {
|
|
10
8
|
return item.group === group;
|
|
@@ -12,17 +10,12 @@ export var itemsInGroup = function itemsInGroup(group, items) {
|
|
|
12
10
|
};
|
|
13
11
|
var List = function List(_ref) {
|
|
14
12
|
var groups = _ref.groups,
|
|
15
|
-
items = _ref.items,
|
|
16
13
|
onItemClick = _ref.onItemClick,
|
|
17
14
|
onItemRemove = _ref.onItemRemove,
|
|
18
15
|
noResultsLabel = _ref.noResultsLabel,
|
|
19
16
|
removeTooltipLabel = _ref.removeTooltipLabel,
|
|
20
17
|
searchValue = _ref.searchValue,
|
|
21
|
-
|
|
22
|
-
visibleItems = _ref.visibleItems,
|
|
23
|
-
_ref$virtualizedRowHe = _ref.virtualizedRowHeight,
|
|
24
|
-
virtualizedRowHeight = _ref$virtualizedRowHe === void 0 ? 32 : _ref$virtualizedRowHe,
|
|
25
|
-
virtualizedRowWidth = _ref.virtualizedRowWidth;
|
|
18
|
+
visibleItems = _ref.visibleItems;
|
|
26
19
|
var groupedList = useMemo(function () {
|
|
27
20
|
return /*#__PURE__*/React.createElement(React.Fragment, null, groups == null ? void 0 : groups.map(function (group) {
|
|
28
21
|
var groupItems = itemsInGroup(group, visibleItems);
|
|
@@ -56,21 +49,8 @@ var List = function List(_ref) {
|
|
|
56
49
|
}, [onItemClick, onItemRemove, removeTooltipLabel, searchValue, visibleItems]);
|
|
57
50
|
var finalItems = groups ? groupedList : standardList;
|
|
58
51
|
return visibleItems.length === 0 ? /*#__PURE__*/React.createElement(S.NoResults, null, /*#__PURE__*/React.createElement(S.NoResultIconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
|
|
59
|
-
component: /*#__PURE__*/React.createElement(
|
|
60
|
-
size:
|
|
61
|
-
})), noResultsLabel) : /*#__PURE__*/React.createElement(S.ListWrapper, null,
|
|
62
|
-
"data-testid": "items-roll-virtualized-list"
|
|
63
|
-
}, /*#__PURE__*/React.createElement(FixedSizeList, {
|
|
64
|
-
height: visibleItems.length * virtualizedRowHeight,
|
|
65
|
-
itemData: items,
|
|
66
|
-
itemCount: visibleItems.length,
|
|
67
|
-
itemSize: virtualizedRowHeight,
|
|
68
|
-
width: virtualizedRowWidth || '100%'
|
|
69
|
-
}, ItemRenderer({
|
|
70
|
-
highlight: searchValue,
|
|
71
|
-
onItemClick: onItemClick,
|
|
72
|
-
onItemRemove: onItemRemove,
|
|
73
|
-
tooltipLabel: removeTooltipLabel
|
|
74
|
-
}))) : finalItems);
|
|
52
|
+
component: /*#__PURE__*/React.createElement(InformationNoSearchResultL, null),
|
|
53
|
+
size: 48
|
|
54
|
+
})), noResultsLabel) : /*#__PURE__*/React.createElement(S.ListWrapper, null, finalItems);
|
|
75
55
|
};
|
|
76
56
|
export default List;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ListItem: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) => import("react").JSX.Element, any, {}, never>;
|
|
1
|
+
export declare const ListItem: import("styled-components").StyledComponent<(props: import("@synerise/ds-list-item").ListItemProps) => React.JSX.Element, any, {}, never>;
|
|
3
2
|
export declare const SuffixelWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-items-roll",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "ItemsRoll UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,22 +34,21 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-button": "^1.4.
|
|
38
|
-
"@synerise/ds-divider": "^1.0.
|
|
39
|
-
"@synerise/ds-dropdown": "^1.0.
|
|
40
|
-
"@synerise/ds-icon": "^1.6.
|
|
41
|
-
"@synerise/ds-list-item": "^1.0.
|
|
42
|
-
"@synerise/ds-menu": "^1.0.
|
|
43
|
-
"@synerise/ds-popconfirm": "^1.0.
|
|
44
|
-
"@synerise/ds-search": "^1.2.
|
|
45
|
-
"@synerise/ds-tooltip": "^1.1.
|
|
46
|
-
"@synerise/ds-utils": "^1.
|
|
47
|
-
"react-window": "^1.8.5"
|
|
37
|
+
"@synerise/ds-button": "^1.4.6",
|
|
38
|
+
"@synerise/ds-divider": "^1.0.17",
|
|
39
|
+
"@synerise/ds-dropdown": "^1.0.19",
|
|
40
|
+
"@synerise/ds-icon": "^1.6.2",
|
|
41
|
+
"@synerise/ds-list-item": "^1.0.17",
|
|
42
|
+
"@synerise/ds-menu": "^1.0.18",
|
|
43
|
+
"@synerise/ds-popconfirm": "^1.0.18",
|
|
44
|
+
"@synerise/ds-search": "^1.2.6",
|
|
45
|
+
"@synerise/ds-tooltip": "^1.1.15",
|
|
46
|
+
"@synerise/ds-utils": "^1.4.0"
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
49
|
"@synerise/ds-core": "*",
|
|
51
50
|
"react": ">=16.9.0 <= 18.3.1",
|
|
52
51
|
"styled-components": "^5.3.3"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "b35b1875727156fe9f5b3bad55aed5ca447c8c8d"
|
|
55
54
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type ListChildComponentProps } from 'react-window';
|
|
3
|
-
import { type ItemRendererProps } from './VirtualizedListItem.types';
|
|
4
|
-
declare const ItemRenderer: ({ highlight, onItemClick, onItemRemove, tooltipLabel, group, }: ItemRendererProps) => ({ index, style, data }: ListChildComponentProps) => React.JSX.Element;
|
|
5
|
-
export default ItemRenderer;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var _excluded = ["suffixel"];
|
|
2
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3
|
-
import React, { useCallback } from 'react';
|
|
4
|
-
import { RemoveIcon } from './ItemRemoveIcon';
|
|
5
|
-
import * as S from './ListItem.styles';
|
|
6
|
-
var ItemRenderer = function ItemRenderer(_ref) {
|
|
7
|
-
var highlight = _ref.highlight,
|
|
8
|
-
onItemClick = _ref.onItemClick,
|
|
9
|
-
onItemRemove = _ref.onItemRemove,
|
|
10
|
-
tooltipLabel = _ref.tooltipLabel,
|
|
11
|
-
group = _ref.group;
|
|
12
|
-
return function (_ref2) {
|
|
13
|
-
var index = _ref2.index,
|
|
14
|
-
style = _ref2.style,
|
|
15
|
-
data = _ref2.data;
|
|
16
|
-
var _ref3 = data[index],
|
|
17
|
-
suffixel = _ref3.suffixel,
|
|
18
|
-
item = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
21
|
-
var onClick = useCallback(function () {
|
|
22
|
-
return onItemClick && onItemClick(item.id, group);
|
|
23
|
-
}, [item.id]);
|
|
24
|
-
return /*#__PURE__*/React.createElement(S.ListItem, {
|
|
25
|
-
className: "items-roll-list-item",
|
|
26
|
-
highlight: highlight,
|
|
27
|
-
onClick: onClick,
|
|
28
|
-
style: style,
|
|
29
|
-
suffixel: /*#__PURE__*/React.createElement(S.SuffixelWrapper, null, /*#__PURE__*/React.createElement(React.Fragment, null, suffixel, !!onItemRemove && /*#__PURE__*/React.createElement(RemoveIcon, {
|
|
30
|
-
id: item.id,
|
|
31
|
-
handleRemove: onItemRemove,
|
|
32
|
-
tooltipLabel: tooltipLabel,
|
|
33
|
-
group: group
|
|
34
|
-
})))
|
|
35
|
-
}, item.text);
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export default ItemRenderer;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { ItemsRollGroup } from '../ItemsRoll.types';
|
|
3
|
-
export type ItemRendererProps = {
|
|
4
|
-
highlight?: string;
|
|
5
|
-
group?: ItemsRollGroup;
|
|
6
|
-
onItemClick?: (id: string, group?: ItemsRollGroup) => void;
|
|
7
|
-
onItemRemove?: (id: string, group?: ItemsRollGroup) => void;
|
|
8
|
-
tooltipLabel: ReactNode;
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|