@synerise/ds-operators 0.9.29 → 0.10.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 +11 -0
- package/dist/Operator.types.d.ts +1 -0
- package/dist/Operators.js +28 -17
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.10.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-operators@0.9.29...@synerise/ds-operators@0.10.0) (2022-12-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **filter:** readOnly state for conditions ([dfa4db3](https://github.com/Synerise/synerise-design/commit/dfa4db35826c0800859b7217dd1ea2f1497ac3c9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.9.29](https://github.com/Synerise/synerise-design/compare/@synerise/ds-operators@0.9.28...@synerise/ds-operators@0.9.29) (2022-12-07)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-operators
|
package/dist/Operator.types.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare type OperatorsProps = {
|
|
|
34
34
|
texts?: Partial<OperatorTexts>;
|
|
35
35
|
opened?: boolean;
|
|
36
36
|
getPopupContainerOverride?: (trigger: HTMLElement | null) => HTMLElement;
|
|
37
|
+
readOnly?: boolean;
|
|
37
38
|
};
|
|
38
39
|
export declare type OperatorsDropdownProps = {
|
|
39
40
|
setDropdownVisible: (show: boolean) => void;
|
package/dist/Operators.js
CHANGED
|
@@ -23,7 +23,9 @@ var Operators = function Operators(_ref) {
|
|
|
23
23
|
opened = _ref.opened,
|
|
24
24
|
getPopupContainerOverride = _ref.getPopupContainerOverride,
|
|
25
25
|
onActivate = _ref.onActivate,
|
|
26
|
-
onDeactivate = _ref.onDeactivate
|
|
26
|
+
onDeactivate = _ref.onDeactivate,
|
|
27
|
+
_ref$readOnly = _ref.readOnly,
|
|
28
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
27
29
|
|
|
28
30
|
var _useIntl = useIntl(),
|
|
29
31
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -66,9 +68,27 @@ var Operators = function Operators(_ref) {
|
|
|
66
68
|
newValue && onActivate && onActivate();
|
|
67
69
|
!newValue && onDeactivate && onDeactivate();
|
|
68
70
|
}, [onActivate, onDeactivate]);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
var triggerMode = React.useMemo(function () {
|
|
72
|
+
if (value) {
|
|
73
|
+
return readOnly ? 'icon-label' : 'two-icons';
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return readOnly ? 'simple' : 'label-icon';
|
|
77
|
+
}, [value, readOnly]);
|
|
78
|
+
var dropdownTrigger = /*#__PURE__*/React.createElement(Tooltip, {
|
|
79
|
+
getPopupContainer: getPopupContainerOverride || getPopupContainer,
|
|
80
|
+
title: (value == null ? void 0 : value.name) || '',
|
|
81
|
+
trigger: ['hover']
|
|
82
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
83
|
+
type: "secondary",
|
|
84
|
+
mode: triggerMode,
|
|
85
|
+
onClick: !readOnly ? handleClick : undefined
|
|
86
|
+
}, value && /*#__PURE__*/React.createElement(Icon, {
|
|
87
|
+
component: value.icon
|
|
88
|
+
}), /*#__PURE__*/React.createElement(S.Value, null, value ? value.name : text.buttonLabel), !readOnly && /*#__PURE__*/React.createElement(Icon, {
|
|
89
|
+
component: /*#__PURE__*/React.createElement(AngleDownS, null)
|
|
90
|
+
})));
|
|
91
|
+
var content = readOnly ? dropdownTrigger : /*#__PURE__*/React.createElement(Dropdown, {
|
|
72
92
|
visible: dropdownVisible,
|
|
73
93
|
onVisibleChange: onDropdownVisibilityChange,
|
|
74
94
|
getPopupContainer: getPopupContainerOverride || getPopupContainer,
|
|
@@ -80,19 +100,10 @@ var Operators = function Operators(_ref) {
|
|
|
80
100
|
items: items,
|
|
81
101
|
texts: text
|
|
82
102
|
})
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
88
|
-
type: "secondary",
|
|
89
|
-
mode: value ? 'two-icons' : 'label-icon',
|
|
90
|
-
onClick: handleClick
|
|
91
|
-
}, value && /*#__PURE__*/React.createElement(Icon, {
|
|
92
|
-
component: value.icon
|
|
93
|
-
}), /*#__PURE__*/React.createElement(S.Value, null, value ? value.name : text.buttonLabel), /*#__PURE__*/React.createElement(Icon, {
|
|
94
|
-
component: /*#__PURE__*/React.createElement(AngleDownS, null)
|
|
95
|
-
})))));
|
|
103
|
+
}, dropdownTrigger);
|
|
104
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
"data-popup-container": true
|
|
106
|
+
}, content);
|
|
96
107
|
};
|
|
97
108
|
|
|
98
109
|
export default Operators;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-operators",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Operators UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"@synerise/ds-core": "*",
|
|
46
46
|
"react": ">=16.9.0 < 17.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "1ab09990244dd615bdfe696f365ae8075bd31762"
|
|
49
49
|
}
|