@synerise/ds-collector 0.5.55 → 0.6.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,27 @@
|
|
|
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.6.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-collector@0.5.56...@synerise/ds-collector@0.6.0) (2023-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **collector:** adds placeholder for missing tests ([7996926](https://github.com/Synerise/synerise-design/commit/7996926f4dd9102a1b9342a7603598342f1bc0cc))
|
|
12
|
+
* **collector:** adds scrollbarProps ([6a67188](https://github.com/Synerise/synerise-design/commit/6a6718814e8fb84c147b69a688d9eee0a3969cb7))
|
|
13
|
+
* **collector:** improves types ([2e1865c](https://github.com/Synerise/synerise-design/commit/2e1865c3868a0d288308eb56cd36d3a5de2f2bf8))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [0.5.56](https://github.com/Synerise/synerise-design/compare/@synerise/ds-collector@0.5.55...@synerise/ds-collector@0.5.56) (2023-03-31)
|
|
20
|
+
|
|
21
|
+
**Note:** Version bump only for package @synerise/ds-collector
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
## [0.5.55](https://github.com/Synerise/synerise-design/compare/@synerise/ds-collector@0.5.54...@synerise/ds-collector@0.5.55) (2023-03-21)
|
|
7
28
|
|
|
8
29
|
**Note:** Version bump only for package @synerise/ds-collector
|
package/README.md
CHANGED
|
@@ -64,6 +64,7 @@ import Collector from '@synerise/ds-collector'
|
|
|
64
64
|
| selected | Array of items which are already selected | CollectorValue[] | [] |
|
|
65
65
|
| suggestions | Array of items which are displayed when showing suggestions dropdown | CollectorValue[] | [] |
|
|
66
66
|
| texts | Texts object for the component | CollectorTexts | {} |
|
|
67
|
+
| scrollbarProps | Object with scrollbar configturaion | ScrollbarAdditionalProps | - |
|
|
67
68
|
|
|
68
69
|
`CollectorValue = {[key:string]: any}`
|
|
69
70
|
|
package/dist/Collector.js
CHANGED
|
@@ -41,7 +41,8 @@ var Collector = function Collector(_ref) {
|
|
|
41
41
|
dropdownItemHeight = _ref.dropdownItemHeight,
|
|
42
42
|
searchValue = _ref.searchValue,
|
|
43
43
|
renderItem = _ref.renderItem,
|
|
44
|
-
onSearchValueChange = _ref.onSearchValueChange
|
|
44
|
+
onSearchValueChange = _ref.onSearchValueChange,
|
|
45
|
+
scrollbarProps = _ref.scrollbarProps;
|
|
45
46
|
var inputRef = React.useRef(null);
|
|
46
47
|
var containerRef = React.useRef(null);
|
|
47
48
|
var mainContentRef = React.useRef(null);
|
|
@@ -271,7 +272,8 @@ var Collector = function Collector(_ref) {
|
|
|
271
272
|
showNavigationHints: showNavigationHints,
|
|
272
273
|
width: getContainerWidth(),
|
|
273
274
|
customContent: dropdownContent,
|
|
274
|
-
texts: texts
|
|
275
|
+
texts: texts,
|
|
276
|
+
scrollbarProps: scrollbarProps
|
|
275
277
|
}), (showError || description) && /*#__PURE__*/React.createElement(S.ContentBelow, null, showError && /*#__PURE__*/React.createElement(S.ErrorText, null, errorText), description && /*#__PURE__*/React.createElement(S.Description, null, description)));
|
|
276
278
|
};
|
|
277
279
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Props as DsButtonProps } from '@synerise/ds-button/dist/Button.types';
|
|
3
|
+
import { ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
|
|
3
4
|
export declare type CollectorProps = {
|
|
4
5
|
addButtonProps?: Partial<DsButtonProps>;
|
|
5
6
|
allowCustomValue?: boolean;
|
|
@@ -31,6 +32,7 @@ export declare type CollectorProps = {
|
|
|
31
32
|
texts: CollectorTexts;
|
|
32
33
|
dropdownItemHeight?: 'large';
|
|
33
34
|
enableCustomFilteringSuggestions?: boolean;
|
|
35
|
+
scrollbarProps?: ScrollbarAdditionalProps;
|
|
34
36
|
};
|
|
35
37
|
export declare type CollectorTexts = {
|
|
36
38
|
add: string | React.ReactNode;
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import Scrollbar from '@synerise/ds-scrollbar';
|
|
3
5
|
import SearchItems from '@synerise/ds-search/dist/Elements/SearchItems/SearchItems';
|
|
@@ -26,7 +28,8 @@ var OptionsDropdown = function OptionsDropdown(_ref) {
|
|
|
26
28
|
texts = _ref.texts,
|
|
27
29
|
customContent = _ref.customContent,
|
|
28
30
|
renderItem = _ref.renderItem,
|
|
29
|
-
dropdownItemHeight = _ref.dropdownItemHeight
|
|
31
|
+
dropdownItemHeight = _ref.dropdownItemHeight,
|
|
32
|
+
scrollbarProps = _ref.scrollbarProps;
|
|
30
33
|
|
|
31
34
|
var _React$useState = React.useState(0),
|
|
32
35
|
scrollTop = _React$useState[0],
|
|
@@ -45,13 +48,13 @@ var OptionsDropdown = function OptionsDropdown(_ref) {
|
|
|
45
48
|
var shouldRenderList = !!(options != null && options.length);
|
|
46
49
|
return /*#__PURE__*/React.createElement(S.DropdownWrapper, {
|
|
47
50
|
onClick: onClick
|
|
48
|
-
}, visible && (customContent ? /*#__PURE__*/React.createElement(S.CustomContentWrapper, null, customContent) : /*#__PURE__*/React.createElement(S.DropdownContent, null, /*#__PURE__*/React.createElement(Scrollbar, {
|
|
51
|
+
}, visible && (customContent ? /*#__PURE__*/React.createElement(S.CustomContentWrapper, null, customContent) : /*#__PURE__*/React.createElement(S.DropdownContent, null, /*#__PURE__*/React.createElement(Scrollbar, _extends({
|
|
49
52
|
absolute: true,
|
|
50
53
|
onScroll: function onScroll(_ref2) {
|
|
51
54
|
var currentTarget = _ref2.currentTarget;
|
|
52
55
|
setScrollTop(currentTarget.scrollTop);
|
|
53
56
|
}
|
|
54
|
-
}, showAddButton && onItemAdd && !!value && /*#__PURE__*/React.createElement(S.DropdownTop, null, /*#__PURE__*/React.createElement(S.DropdownAddButton, {
|
|
57
|
+
}, scrollbarProps), showAddButton && onItemAdd && !!value && /*#__PURE__*/React.createElement(S.DropdownTop, null, /*#__PURE__*/React.createElement(S.DropdownAddButton, {
|
|
55
58
|
onClick: function onClick() {
|
|
56
59
|
onItemAdd && onItemAdd(value);
|
|
57
60
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ScrollbarAdditionalProps } from '@synerise/ds-scrollbar';
|
|
2
3
|
import { CollectorTexts, CollectorValue } from '../../Collector.types';
|
|
3
4
|
export declare type OptionsDropdownProps = {
|
|
4
5
|
showAddButton?: boolean;
|
|
@@ -15,4 +16,5 @@ export declare type OptionsDropdownProps = {
|
|
|
15
16
|
lookupKey: string;
|
|
16
17
|
customContent?: React.ReactNode;
|
|
17
18
|
dropdownItemHeight?: 'large';
|
|
19
|
+
scrollbarProps?: ScrollbarAdditionalProps;
|
|
18
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-collector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Collector UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@synerise/ds-button": "^0.17.12",
|
|
36
36
|
"@synerise/ds-icon": "^0.54.0",
|
|
37
|
-
"@synerise/ds-input": "^0.18.
|
|
38
|
-
"@synerise/ds-search": "^0.8.
|
|
37
|
+
"@synerise/ds-input": "^0.18.37",
|
|
38
|
+
"@synerise/ds-search": "^0.8.46",
|
|
39
39
|
"classnames": "^2.2.6"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@synerise/ds-core": "*",
|
|
43
43
|
"react": ">=16.9.0 < 17.0.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "42bda32506d121cbc207c73efca09f300a749120"
|
|
46
46
|
}
|