@synerise/ds-operators 0.8.0 → 0.9.1
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 +30 -0
- package/README.md +11 -9
- package/dist/Operator.types.d.ts +1 -0
- package/dist/Operators.js +11 -7
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.9.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-operators@0.9.0...@synerise/ds-operators@0.9.1) (2022-06-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-operators
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.9.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-operators@0.8.1...@synerise/ds-operators@0.9.0) (2022-04-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **operators:** adds onDeactivate prop, update Readme.md ([07f6446](https://github.com/Synerise/synerise-design/commit/07f6446ded7253ab994b4df5c0b5da1c2727aa10))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.8.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-operators@0.8.0...@synerise/ds-operators@0.8.1) (2022-04-12)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* fix filter dropdowns ([eaab107](https://github.com/Synerise/synerise-design/commit/eaab107b6dca7401a17c2e36806febd11edc677b))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
# [0.8.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-operators@0.7.9...@synerise/ds-operators@0.8.0) (2022-04-05)
|
|
7
37
|
|
|
8
38
|
|
package/README.md
CHANGED
|
@@ -76,15 +76,17 @@ import Operators from '@synerise/ds-operators'
|
|
|
76
76
|
|
|
77
77
|
## API
|
|
78
78
|
|
|
79
|
-
| Property
|
|
80
|
-
| ---
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
79
|
+
| Property | Description | Type | Default |
|
|
80
|
+
| --- | --- | --- | --- |
|
|
81
|
+
| getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement \ null) => HTMLElement; | - |
|
|
82
|
+
| groups | Groups of operators | OperatorsGroup[] | [] |
|
|
83
|
+
| items | Array of operators | OperatorsItem[] | [] |
|
|
84
|
+
| onActivate | Callback called when user opens dropdown | (fieldType: string) => void | - |
|
|
85
|
+
| onChange | Callback called when user selects operator | (item: OperatorsItem \ OperatorsGroup \ undefined) => void | - |
|
|
86
|
+
| onDeactivate | Callback called when user closes dropdown | () => void | - |
|
|
87
|
+
| opened | Whether if dropdown should opens from outside of component | boolean | false |
|
|
88
|
+
| texts | Translations object | OperatorTexts | - |
|
|
89
|
+
| value | Selected operator | OperatorsItem \ undefined | undefined |
|
|
88
90
|
|
|
89
91
|
### OperatorsGroup
|
|
90
92
|
|
package/dist/Operator.types.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare type OperatorsGroup = {
|
|
|
27
27
|
export declare type OperatorsProps = {
|
|
28
28
|
value?: OperatorsItem | undefined;
|
|
29
29
|
onActivate?: () => void;
|
|
30
|
+
onDeactivate?: () => void;
|
|
30
31
|
onChange: (item: OperatorsItem | undefined) => void;
|
|
31
32
|
groups: OperatorsGroup[];
|
|
32
33
|
items: OperatorsItem[];
|
package/dist/Operators.js
CHANGED
|
@@ -22,7 +22,8 @@ var Operators = function Operators(_ref) {
|
|
|
22
22
|
texts = _ref.texts,
|
|
23
23
|
opened = _ref.opened,
|
|
24
24
|
getPopupContainerOverride = _ref.getPopupContainerOverride,
|
|
25
|
-
onActivate = _ref.onActivate
|
|
25
|
+
onActivate = _ref.onActivate,
|
|
26
|
+
onDeactivate = _ref.onDeactivate;
|
|
26
27
|
|
|
27
28
|
var _useIntl = useIntl(),
|
|
28
29
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -51,17 +52,20 @@ var Operators = function Operators(_ref) {
|
|
|
51
52
|
onChange(val);
|
|
52
53
|
}, [onChange]);
|
|
53
54
|
React.useEffect(function () {
|
|
55
|
+
setDropdownVisible(Boolean(opened));
|
|
56
|
+
|
|
54
57
|
if (opened) {
|
|
55
|
-
|
|
58
|
+
onActivate && onActivate();
|
|
56
59
|
}
|
|
57
|
-
}, [opened]);
|
|
60
|
+
}, [onActivate, opened]);
|
|
58
61
|
var handleClick = React.useCallback(function () {
|
|
59
|
-
setDropdownVisible(true);
|
|
60
62
|
onActivate && onActivate();
|
|
61
|
-
|
|
62
|
-
var onDropdownVisibilityChange = React.useCallback(function (newValue) {
|
|
63
|
-
return newValue && onActivate && onActivate();
|
|
63
|
+
setDropdownVisible(true);
|
|
64
64
|
}, [onActivate]);
|
|
65
|
+
var onDropdownVisibilityChange = React.useCallback(function (newValue) {
|
|
66
|
+
newValue && onActivate && onActivate();
|
|
67
|
+
!newValue && onDeactivate && onDeactivate();
|
|
68
|
+
}, [onActivate, onDeactivate]);
|
|
65
69
|
return /*#__PURE__*/React.createElement("div", {
|
|
66
70
|
"data-popup-container": true
|
|
67
71
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-operators",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Operators UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@synerise/ds-button": "^0.17.2",
|
|
36
|
-
"@synerise/ds-dropdown": "^0.17.
|
|
36
|
+
"@synerise/ds-dropdown": "^0.17.18",
|
|
37
37
|
"@synerise/ds-icon": "^0.49.0",
|
|
38
|
-
"@synerise/ds-menu": "^0.
|
|
38
|
+
"@synerise/ds-menu": "^0.14.0",
|
|
39
39
|
"@synerise/ds-result": "^0.6.9",
|
|
40
40
|
"@synerise/ds-scrollbar": "^0.4.7",
|
|
41
|
-
"@synerise/ds-tabs": "^0.13.
|
|
41
|
+
"@synerise/ds-tabs": "^0.13.12",
|
|
42
42
|
"@synerise/ds-utils": "^0.19.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@synerise/ds-core": "*",
|
|
46
46
|
"react": ">=16.9.0 < 17.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "d787395998e479858cb58f6d56555e4c51fe45d5"
|
|
49
49
|
}
|