@synerise/ds-context-selector 0.19.4 → 0.19.6
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,22 @@
|
|
|
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.19.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-context-selector@0.19.5...@synerise/ds-context-selector@0.19.6) (2023-09-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-context-selector
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.19.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-context-selector@0.19.4...@synerise/ds-context-selector@0.19.5) (2023-09-08)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-context-selector
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.19.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-context-selector@0.19.3...@synerise/ds-context-selector@0.19.4) (2023-09-05)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @synerise/ds-context-selector
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode, ReactText } from 'react';
|
|
3
2
|
import { HandledEventsType } from '@synerise/ds-utils';
|
|
4
3
|
import { ItemSize } from '@synerise/ds-menu';
|
|
5
4
|
import { DropdownProps } from '@synerise/ds-dropdown/dist/Dropdown';
|
|
@@ -11,24 +10,24 @@ export declare type ContextTexts = {
|
|
|
11
10
|
noResults: string;
|
|
12
11
|
};
|
|
13
12
|
export declare type ContextItem = {
|
|
14
|
-
id:
|
|
13
|
+
id: ReactText | null;
|
|
15
14
|
name: string;
|
|
16
|
-
icon:
|
|
17
|
-
customSuffix?:
|
|
18
|
-
description?:
|
|
19
|
-
groupId?:
|
|
15
|
+
icon: ReactNode;
|
|
16
|
+
customSuffix?: ReactNode;
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
groupId?: ReactText;
|
|
20
19
|
groupName?: string;
|
|
21
20
|
subGroups?: ContextGroup[];
|
|
22
21
|
useCustomIcon?: boolean;
|
|
23
22
|
subtitle?: string;
|
|
24
23
|
};
|
|
25
24
|
export declare type ContextGroup = {
|
|
26
|
-
id:
|
|
25
|
+
id: ReactText;
|
|
27
26
|
name: string;
|
|
28
|
-
customSuffix?:
|
|
27
|
+
customSuffix?: ReactNode;
|
|
29
28
|
defaultGroup?: boolean;
|
|
30
|
-
description?:
|
|
31
|
-
icon?:
|
|
29
|
+
description?: ReactNode;
|
|
30
|
+
icon?: ReactNode;
|
|
32
31
|
itemType?: string;
|
|
33
32
|
tooltip?: string;
|
|
34
33
|
subGroups?: ContextGroup[];
|
|
@@ -53,7 +52,7 @@ export declare type ContextProps = {
|
|
|
53
52
|
opened?: boolean;
|
|
54
53
|
addMode?: boolean;
|
|
55
54
|
loading?: boolean;
|
|
56
|
-
customTriggerComponent?:
|
|
55
|
+
customTriggerComponent?: ReactNode;
|
|
57
56
|
trigger?: ('click' | 'hover' | 'contextMenu')[];
|
|
58
57
|
menuItemHeight?: ItemSize;
|
|
59
58
|
dropdownWrapperStyles?: CSSProperties;
|
|
@@ -65,7 +64,7 @@ export declare type ContextProps = {
|
|
|
65
64
|
hasMoreItems?: boolean;
|
|
66
65
|
type?: 'default' | 'attribute' | 'event';
|
|
67
66
|
dropdownProps?: Omit<DropdownProps, 'trigger' | 'getPopupContainer' | 'onVisibleChange' | 'visible' | 'overlay'>;
|
|
68
|
-
errorText?:
|
|
67
|
+
errorText?: ReactNode | string;
|
|
69
68
|
getMenuEntryProps?: FactorsProps['getMenuEntryProps'];
|
|
70
69
|
};
|
|
71
70
|
export declare type ContextDropdownProps = {
|
|
@@ -85,7 +84,7 @@ export declare type ContextDropdownProps = {
|
|
|
85
84
|
onSearch?: (query: string) => void;
|
|
86
85
|
onFetchData?: () => void;
|
|
87
86
|
hasMoreItems?: boolean;
|
|
88
|
-
style?:
|
|
87
|
+
style?: CSSProperties;
|
|
89
88
|
};
|
|
90
89
|
export declare type ContextSelectorDropdownItemProps = {
|
|
91
90
|
item: ContextItem | ContextGroup;
|
|
@@ -96,7 +95,7 @@ export declare type ContextSelectorDropdownItemProps = {
|
|
|
96
95
|
selected?: boolean;
|
|
97
96
|
className: string;
|
|
98
97
|
menuItemHeight?: ItemSize;
|
|
99
|
-
style?:
|
|
98
|
+
style?: CSSProperties;
|
|
100
99
|
};
|
|
101
100
|
export declare type ListItem = {
|
|
102
101
|
className: string;
|
|
@@ -29,6 +29,10 @@ function isListTitle(element) {
|
|
|
29
29
|
return element.title !== undefined;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
function isGroup(item) {
|
|
33
|
+
return 'isGroup' in item;
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
var ContextSelectorDropdown = function ContextSelectorDropdown(_ref) {
|
|
33
37
|
var texts = _ref.texts,
|
|
34
38
|
setSelected = _ref.setSelected,
|
|
@@ -83,8 +87,10 @@ var ContextSelectorDropdown = function ContextSelectorDropdown(_ref) {
|
|
|
83
87
|
return "ds-context-item ds-context-item-" + uuid();
|
|
84
88
|
}, []);
|
|
85
89
|
var handleOnSetGroup = React.useCallback(function (item) {
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
if (isGroup(item)) {
|
|
91
|
+
onSetGroup && onSetGroup(item);
|
|
92
|
+
setActiveGroup(item);
|
|
93
|
+
}
|
|
88
94
|
}, [onSetGroup]);
|
|
89
95
|
useOnClickOutside(overlayRef, function (event) {
|
|
90
96
|
if (getClosest(event.target, '.ds-info-card') === null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-context-selector",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.6",
|
|
4
4
|
"description": "ContextSelector UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test:watch": "npm run test -- --watchAll",
|
|
27
27
|
"types": "tsc --noEmit"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "537a85e8d61ceb4ad23babf222ba18b94fbfb319",
|
|
30
30
|
"sideEffects": [
|
|
31
31
|
"dist/style/*",
|
|
32
32
|
"*.less"
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@synerise/ds-button": "^0.18.1",
|
|
37
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
38
|
-
"@synerise/ds-factors": "^0.19.
|
|
37
|
+
"@synerise/ds-dropdown": "^0.17.77",
|
|
38
|
+
"@synerise/ds-factors": "^0.19.6",
|
|
39
39
|
"@synerise/ds-icon": "^0.58.1",
|
|
40
|
-
"@synerise/ds-information-card": "^0.3.
|
|
40
|
+
"@synerise/ds-information-card": "^0.3.34",
|
|
41
41
|
"@synerise/ds-loader": "^0.2.43",
|
|
42
42
|
"@synerise/ds-menu": "^0.17.17",
|
|
43
|
-
"@synerise/ds-result": "^0.6.
|
|
43
|
+
"@synerise/ds-result": "^0.6.30",
|
|
44
44
|
"@synerise/ds-scrollbar": "^0.6.6",
|
|
45
|
-
"@synerise/ds-tabs": "^0.13.
|
|
45
|
+
"@synerise/ds-tabs": "^0.13.74",
|
|
46
46
|
"@synerise/ds-utils": "^0.24.15",
|
|
47
47
|
"react-window": "1.8.5",
|
|
48
48
|
"uuid": "^8.3.2"
|