@synerise/ds-logic 0.7.8 → 0.8.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 +19 -0
- package/dist/Logic.js +5 -2
- package/dist/Logic.style.d.ts +3 -1
- package/dist/Logic.style.js +8 -10
- package/dist/Logic.types.d.ts +1 -0
- package/dist/Matching/Matching.js +7 -4
- package/dist/Matching/Matching.styles.d.ts +1 -0
- package/dist/Matching/Matching.styles.js +12 -12
- package/dist/Matching/Matching.types.d.ts +1 -0
- package/package.json +3 -3
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.8.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-logic@0.7.9...@synerise/ds-logic@0.8.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
|
+
|
|
17
|
+
## [0.7.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-logic@0.7.8...@synerise/ds-logic@0.7.9) (2022-12-07)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-logic
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.7.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-logic@0.7.7...@synerise/ds-logic@0.7.8) (2022-08-31)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-logic
|
package/dist/Logic.js
CHANGED
|
@@ -8,7 +8,9 @@ var DEFAULT_OPTIONS = ['AND', 'OR'];
|
|
|
8
8
|
var Logic = function Logic(_ref) {
|
|
9
9
|
var value = _ref.value,
|
|
10
10
|
options = _ref.options,
|
|
11
|
-
onChange = _ref.onChange
|
|
11
|
+
onChange = _ref.onChange,
|
|
12
|
+
_ref$readOnly = _ref.readOnly,
|
|
13
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
12
14
|
var intl = useIntl();
|
|
13
15
|
var operators = React.useMemo(function () {
|
|
14
16
|
if (options !== undefined && options.length) {
|
|
@@ -40,7 +42,8 @@ var Logic = function Logic(_ref) {
|
|
|
40
42
|
}, [operators, value]);
|
|
41
43
|
return /*#__PURE__*/React.createElement(S.Logic, {
|
|
42
44
|
className: "ds-logic",
|
|
43
|
-
onClick: handleNextLogic
|
|
45
|
+
onClick: !readOnly ? handleNextLogic : undefined,
|
|
46
|
+
readOnly: readOnly
|
|
44
47
|
}, /*#__PURE__*/React.createElement(Title, {
|
|
45
48
|
withoutMargin: true,
|
|
46
49
|
level: 4
|
package/dist/Logic.style.d.ts
CHANGED
package/dist/Logic.style.js
CHANGED
|
@@ -3,14 +3,12 @@ import styled from 'styled-components'; // eslint-disable-next-line import/prefe
|
|
|
3
3
|
export var Logic = styled.div.withConfig({
|
|
4
4
|
displayName: "Logicstyle__Logic",
|
|
5
5
|
componentId: "yp0pif-0"
|
|
6
|
-
})(["user-select:none;position:relative;.ds-title{cursor:pointer
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
}, function (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
}, function (props) {
|
|
15
|
-
return props.theme.palette.white;
|
|
6
|
+
})(["user-select:none;position:relative;.ds-title{cursor:pointer;", "}", ""], function (_ref) {
|
|
7
|
+
var readOnly = _ref.readOnly,
|
|
8
|
+
theme = _ref.theme;
|
|
9
|
+
return !readOnly ? "&:after {\n position: absolute;\n bottom: -2px;\n width: 100%;\n content: '';\n height: 1px;\n left: 1px;\n background-image: linear-gradient(\n to right,\n " + theme.palette['grey-600'] + " 25%,\n " + theme.palette.white + " 0%\n );\n background-position: top;\n background-size: 4px 1px;\n background-repeat: repeat-x;\n }" : '';
|
|
10
|
+
}, function (_ref2) {
|
|
11
|
+
var readOnly = _ref2.readOnly,
|
|
12
|
+
theme = _ref2.theme;
|
|
13
|
+
return !readOnly ? " &:hover {\n .ds-title {\n color: " + theme.palette['blue-700'] + ";\n &:after {\n background-image: linear-gradient(\n to right,\n " + theme.palette['blue-700'] + " 25%,\n " + theme.palette.white + " 0%\n );\n }\n }\n }" : '';
|
|
16
14
|
});
|
package/dist/Logic.types.d.ts
CHANGED
|
@@ -14,7 +14,9 @@ var Matching = function Matching(_ref) {
|
|
|
14
14
|
matching = _ref$matching === void 0 ? true : _ref$matching,
|
|
15
15
|
sentence = _ref.sentence,
|
|
16
16
|
onChange = _ref.onChange,
|
|
17
|
-
texts = _ref.texts
|
|
17
|
+
texts = _ref.texts,
|
|
18
|
+
_ref$readOnly = _ref.readOnly,
|
|
19
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
|
|
18
20
|
var intl = useIntl();
|
|
19
21
|
var text = React.useMemo(function () {
|
|
20
22
|
return _objectSpread({
|
|
@@ -33,11 +35,12 @@ var Matching = function Matching(_ref) {
|
|
|
33
35
|
}, [onChange, matching]);
|
|
34
36
|
var getToggle = React.useMemo(function () {
|
|
35
37
|
return /*#__PURE__*/React.createElement(S.Toggle, {
|
|
36
|
-
onClick: handleClick,
|
|
38
|
+
onClick: !readOnly ? handleClick : undefined,
|
|
37
39
|
matching: matching,
|
|
38
|
-
className: "ds-matching-toggle"
|
|
40
|
+
className: "ds-matching-toggle",
|
|
41
|
+
readOnly: readOnly
|
|
39
42
|
}, matching ? text.matching : text.notMatching);
|
|
40
|
-
}, [handleClick, matching, text]);
|
|
43
|
+
}, [handleClick, matching, text, readOnly]);
|
|
41
44
|
var getLabelWithToggle = React.useMemo(function () {
|
|
42
45
|
if (sentence) {
|
|
43
46
|
var startOfToggle = sentence == null ? void 0 : sentence.search(MATCHING_TOGGLE);
|
|
@@ -8,16 +8,16 @@ export var MatchingWrapper = styled.div.withConfig({
|
|
|
8
8
|
export var Toggle = styled.span.withConfig({
|
|
9
9
|
displayName: "Matchingstyles__Toggle",
|
|
10
10
|
componentId: "sc-7z57qz-1"
|
|
11
|
-
})(["cursor:pointer;font-size:16px;font-weight:500;line-height:1.25;color:", ";transition:color 0.1s ease-in-out;position:relative;display:inline-flex
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
}, function (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
}, function (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return
|
|
11
|
+
})(["cursor:pointer;font-size:16px;font-weight:500;line-height:1.25;color:", ";transition:color 0.1s ease-in-out;position:relative;display:inline-flex;", " ", ""], function (_ref) {
|
|
12
|
+
var readOnly = _ref.readOnly,
|
|
13
|
+
theme = _ref.theme;
|
|
14
|
+
return theme.palette[readOnly ? "grey-800" : "blue-600"];
|
|
15
|
+
}, function (_ref2) {
|
|
16
|
+
var readOnly = _ref2.readOnly,
|
|
17
|
+
theme = _ref2.theme;
|
|
18
|
+
return !readOnly ? "\n &:after {\n position: absolute;\n bottom: -2px;\n width: 100%;\n content: '';\n height: 1px;\n left: 1px;\n background-image: linear-gradient(\n to right,\n " + theme.palette['blue-600'] + " 25%,\n " + theme.palette.white + " 0%\n );\n background-position: top;\n background-size: 4px 1px;\n background-repeat: repeat-x;\n }" : '';
|
|
19
|
+
}, function (_ref3) {
|
|
20
|
+
var readOnly = _ref3.readOnly,
|
|
21
|
+
theme = _ref3.theme;
|
|
22
|
+
return !readOnly ? " &:hover {\n color: " + theme.palette["blue-700"] + ";\n &:after {\n background-image: linear-gradient(\n to right,\n " + theme.palette['blue-700'] + " 25%,\n " + theme.palette.white + " 0%\n );\n }\n }" : '';
|
|
23
23
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-logic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Logic UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
35
|
+
"@synerise/ds-icon": "^0.52.0",
|
|
36
36
|
"@synerise/ds-typography": "^0.12.7",
|
|
37
37
|
"@synerise/ds-utils": "^0.19.0"
|
|
38
38
|
},
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@synerise/ds-core": "*",
|
|
41
41
|
"react": ">=16.9.0 < 17.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "1ab09990244dd615bdfe696f365ae8075bd31762"
|
|
44
44
|
}
|