@synerise/ds-collector 0.10.9 → 0.11.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
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
|
+
# [0.11.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-collector@0.10.10...@synerise/ds-collector@0.11.0) (2024-08-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **storybook7:** added collector stories ([1e4f777](https://github.com/Synerise/synerise-design/commit/1e4f777f50363e34e21ff7d1b4b4fead31741b7b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.10.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-collector@0.10.9...@synerise/ds-collector@0.10.10) (2024-08-19)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-collector
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.10.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-collector@0.10.8...@synerise/ds-collector@0.10.9) (2024-08-06)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-collector
|
package/dist/Collector.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ declare const Collector: {
|
|
|
34
34
|
Label: import("styled-components").StyledComponent<"label", any, {}, never>;
|
|
35
35
|
Values: React.FC<import("./Elements/Values/Values.types").ValuesProps>;
|
|
36
36
|
ButtonPanel: React.FC<import("./Elements/ButtonPanel/ButtonPanel.types").ButtonPanelProps>;
|
|
37
|
-
OptionsDropdown:
|
|
37
|
+
OptionsDropdown: ({ showAddButton, options, visible, value, onSelect, onClick, width, onItemAdd, showNavigationHints, lookupKey, texts, customContent, renderItem, dropdownItemHeight, scrollbarProps, listHeader, }: import("./Elements/OptionsDropdown/OptionsDropdown.types").OptionsDropdownProps) => React.JSX.Element;
|
|
38
38
|
NavigationHint: React.FC<import("./Elements/NavigationHint/NavigationHint.types").NavigationHintProps>;
|
|
39
39
|
};
|
|
40
40
|
export default Collector;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { OptionsDropdownProps } from './OptionsDropdown.types';
|
|
3
|
-
declare const OptionsDropdown: React.
|
|
3
|
+
declare const OptionsDropdown: ({ showAddButton, options, visible, value, onSelect, onClick, width, onItemAdd, showNavigationHints, lookupKey, texts, customContent, renderItem, dropdownItemHeight, scrollbarProps, listHeader, }: OptionsDropdownProps) => React.JSX.Element;
|
|
4
4
|
export default OptionsDropdown;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
4
4
|
import Scrollbar from '@synerise/ds-scrollbar';
|
|
5
5
|
import SearchItems from '@synerise/ds-search/dist/Elements/SearchItems/SearchItems';
|
|
6
6
|
import Icon, { Add3M } from '@synerise/ds-icon';
|
|
@@ -9,7 +9,7 @@ import ListItem from '@synerise/ds-list-item';
|
|
|
9
9
|
import * as S from '../../Collector.styles';
|
|
10
10
|
import NavigationHint from '../NavigationHint/NavigationHint';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var getRowHeight = function getRowHeight(size) {
|
|
13
13
|
if (size === 'large') return 54;
|
|
14
14
|
return 32;
|
|
15
15
|
};
|
|
@@ -32,14 +32,14 @@ var OptionsDropdown = function OptionsDropdown(_ref) {
|
|
|
32
32
|
scrollbarProps = _ref.scrollbarProps,
|
|
33
33
|
listHeader = _ref.listHeader;
|
|
34
34
|
|
|
35
|
-
var
|
|
36
|
-
scrollTop =
|
|
37
|
-
setScrollTop =
|
|
35
|
+
var _useState = useState(0),
|
|
36
|
+
scrollTop = _useState[0],
|
|
37
|
+
setScrollTop = _useState[1];
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
useEffect(function () {
|
|
40
40
|
setScrollTop(0);
|
|
41
41
|
}, [visible]);
|
|
42
|
-
var renderItemFn =
|
|
42
|
+
var renderItemFn = useCallback(function (itemValue) {
|
|
43
43
|
return renderItem ? renderItem(itemValue) : /*#__PURE__*/React.createElement(ListItem, {
|
|
44
44
|
tabIndex: -1,
|
|
45
45
|
size: dropdownItemHeight,
|
|
@@ -48,7 +48,8 @@ var OptionsDropdown = function OptionsDropdown(_ref) {
|
|
|
48
48
|
}, [lookupKey, renderItem, dropdownItemHeight]);
|
|
49
49
|
var shouldRenderList = !!(options != null && options.length);
|
|
50
50
|
return /*#__PURE__*/React.createElement(S.DropdownWrapper, {
|
|
51
|
-
onClick: onClick
|
|
51
|
+
onClick: onClick,
|
|
52
|
+
"data-testid": "ds-collector-dropdown"
|
|
52
53
|
}, visible && (customContent ? /*#__PURE__*/React.createElement(S.CustomContentWrapper, null, customContent) : /*#__PURE__*/React.createElement(S.DropdownContent, null, listHeader, /*#__PURE__*/React.createElement(Scrollbar, _extends({
|
|
53
54
|
absolute: true,
|
|
54
55
|
onScroll: function onScroll(_ref2) {
|
|
@@ -71,11 +72,12 @@ var OptionsDropdown = function OptionsDropdown(_ref) {
|
|
|
71
72
|
visibleRows: 6,
|
|
72
73
|
onItemClick: onSelect,
|
|
73
74
|
itemRender: renderItemFn,
|
|
74
|
-
rowHeight:
|
|
75
|
+
rowHeight: getRowHeight(dropdownItemHeight),
|
|
75
76
|
width: width,
|
|
76
77
|
listProps: {
|
|
77
78
|
scrollTop: scrollTop
|
|
78
|
-
}
|
|
79
|
+
},
|
|
80
|
+
renderInMenu: false
|
|
79
81
|
})), showNavigationHints && /*#__PURE__*/React.createElement(NavigationHint, {
|
|
80
82
|
texts: texts
|
|
81
83
|
}))));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Collector';
|
|
2
|
-
export type { CollectorValue } from './Collector.types';
|
|
2
|
+
export type { CollectorValue, CollectorProps, CollectorValuesSeparator, CollectorTexts } from './Collector.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-collector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Collector UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,17 +33,16 @@
|
|
|
33
33
|
],
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@synerise/ds-button": "^0.21.
|
|
37
|
-
"@synerise/ds-divider": "^0.7.
|
|
38
|
-
"@synerise/ds-icon": "^0.
|
|
39
|
-
"@synerise/ds-input": "^0.
|
|
40
|
-
"@synerise/ds-list-item": "^0.4.
|
|
41
|
-
"@synerise/ds-
|
|
42
|
-
"@synerise/ds-
|
|
43
|
-
"@synerise/ds-search": "^0.9.4",
|
|
36
|
+
"@synerise/ds-button": "^0.21.6",
|
|
37
|
+
"@synerise/ds-divider": "^0.7.2",
|
|
38
|
+
"@synerise/ds-icon": "^0.65.1",
|
|
39
|
+
"@synerise/ds-input": "^0.24.0",
|
|
40
|
+
"@synerise/ds-list-item": "^0.4.6",
|
|
41
|
+
"@synerise/ds-scrollbar": "^0.11.6",
|
|
42
|
+
"@synerise/ds-search": "^0.9.6",
|
|
44
43
|
"@synerise/ds-utils": "^0.28.2",
|
|
45
44
|
"classnames": "2.3.2",
|
|
46
|
-
"react-intl": "
|
|
45
|
+
"react-intl": "3.12.0"
|
|
47
46
|
},
|
|
48
47
|
"peerDependencies": {
|
|
49
48
|
"@synerise/ds-core": "*",
|
|
@@ -51,5 +50,5 @@
|
|
|
51
50
|
"react": ">=16.9.0 <= 17.0.2",
|
|
52
51
|
"styled-components": "5.0.1"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "a035aeea499cea00e72e20e3790c0ffcad4fe956"
|
|
55
54
|
}
|