@synerise/ds-filter 0.6.4 → 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 +36 -0
- package/dist/Filter.js +37 -3
- package/dist/Filter.styles.js +6 -6
- package/dist/Filter.types.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,42 @@
|
|
|
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-filter@0.7.1...@synerise/ds-filter@0.8.0) (2022-04-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **factors:** adds onDeactivate prop, updates Readme.md ([ff85234](https://github.com/Synerise/synerise-design/commit/ff852349a5c77047d6d0642d4b5587dbcc6d24cd))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.7.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.7.0...@synerise/ds-filter@0.7.1) (2022-04-08)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-filter
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [0.7.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.6.4...@synerise/ds-filter@0.7.0) (2022-04-05)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* fix eslint errors ([7cce9b9](https://github.com/Synerise/synerise-design/commit/7cce9b94f8dea533b3c36a0f0cfd5145d4737166))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **filter:** fixes bugs ([b862ddd](https://github.com/Synerise/synerise-design/commit/b862dddbce1293c2a5381663fc903bb574edd135))
|
|
36
|
+
* **filter:** updates styles ([a826761](https://github.com/Synerise/synerise-design/commit/a826761de845a47f8436d22a7307f2c03bb197e0))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
6
42
|
## [0.6.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.6.3...@synerise/ds-filter@0.6.4) (2022-03-30)
|
|
7
43
|
|
|
8
44
|
**Note:** Version bump only for package @synerise/ds-filter
|
package/dist/Filter.js
CHANGED
|
@@ -20,7 +20,8 @@ var SORTABLE_CONFIG = {
|
|
|
20
20
|
className: 'sortable-list',
|
|
21
21
|
handle: '.step-card-drag-handler',
|
|
22
22
|
animation: 200,
|
|
23
|
-
forceFallback: true
|
|
23
|
+
forceFallback: true,
|
|
24
|
+
filter: '.ds-matching-toggle, .ds-cruds'
|
|
24
25
|
};
|
|
25
26
|
var component = {
|
|
26
27
|
LOGIC: Logic,
|
|
@@ -72,6 +73,30 @@ var Filter = function Filter(_ref) {
|
|
|
72
73
|
notMatching: formatMessage({
|
|
73
74
|
id: 'DS.MATCHING.NOT-MATCHING'
|
|
74
75
|
}),
|
|
76
|
+
have: formatMessage({
|
|
77
|
+
id: 'DS.MATCHING.HAVE',
|
|
78
|
+
defaultMessage: 'Have'
|
|
79
|
+
}),
|
|
80
|
+
performed: formatMessage({
|
|
81
|
+
id: 'DS.MATCHING.PERFORMED',
|
|
82
|
+
defaultMessage: 'Performed'
|
|
83
|
+
}),
|
|
84
|
+
notHave: formatMessage({
|
|
85
|
+
id: 'DS.MATCHING.NOT-HAVE',
|
|
86
|
+
defaultMessage: 'Does not have'
|
|
87
|
+
}),
|
|
88
|
+
notPerformed: formatMessage({
|
|
89
|
+
id: 'DS.MATCHING.NOT-PERFORMED',
|
|
90
|
+
defaultMessage: 'Have not performed'
|
|
91
|
+
}),
|
|
92
|
+
attribute: formatMessage({
|
|
93
|
+
id: 'DS.MATCHING.EXPRESSION-TYPE.ATTRIBUTE',
|
|
94
|
+
defaultMessage: 'attribute'
|
|
95
|
+
}),
|
|
96
|
+
event: formatMessage({
|
|
97
|
+
id: 'DS.MATCHING.EXPRESSION-TYPE.EVENT',
|
|
98
|
+
defaultMessage: 'event'
|
|
99
|
+
}),
|
|
75
100
|
namePlaceholder: formatMessage({
|
|
76
101
|
id: 'DS.STEP-CARD.NAME-PLACEHOLDER'
|
|
77
102
|
}),
|
|
@@ -95,7 +120,16 @@ var Filter = function Filter(_ref) {
|
|
|
95
120
|
}
|
|
96
121
|
});
|
|
97
122
|
}, [formatMessage, texts]);
|
|
123
|
+
var getContextTypeTexts = React.useCallback(function (expression) {
|
|
124
|
+
var contextType = expression.expressionType;
|
|
125
|
+
return {
|
|
126
|
+
matching: contextType === 'attribute' ? text.step.have : text.step.performed,
|
|
127
|
+
notMatching: contextType === 'attribute' ? text.step.notHave : text.step.notPerformed,
|
|
128
|
+
conditionType: contextType === 'attribute' ? text.step.attribute : text.step.event
|
|
129
|
+
};
|
|
130
|
+
}, [text]);
|
|
98
131
|
var componentProps = React.useCallback(function (expression) {
|
|
132
|
+
var contextTypeTexts = getContextTypeTexts(expression);
|
|
99
133
|
var props = {
|
|
100
134
|
LOGIC: {
|
|
101
135
|
onChange: function onChange(value) {
|
|
@@ -117,11 +151,11 @@ var Filter = function Filter(_ref) {
|
|
|
117
151
|
},
|
|
118
152
|
footer: renderStepFooter && renderStepFooter(expression),
|
|
119
153
|
children: renderStepContent && renderStepContent(expression),
|
|
120
|
-
texts: text.step
|
|
154
|
+
texts: _objectSpread({}, text.step, {}, contextTypeTexts)
|
|
121
155
|
}
|
|
122
156
|
};
|
|
123
157
|
return props[expression.type];
|
|
124
|
-
}, [onChangeLogic, onChangeStepMatching, onChangeStepName, onDeleteStep, onDuplicateStep, renderStepContent, renderStepFooter, text]);
|
|
158
|
+
}, [getContextTypeTexts, onChangeLogic, onChangeStepMatching, onChangeStepName, onDeleteStep, onDuplicateStep, renderStepContent, renderStepFooter, text.step]);
|
|
125
159
|
var renderExpression = React.useCallback(function (expression, index) {
|
|
126
160
|
var Component = component[expression.type];
|
|
127
161
|
var LogicComponent = expression.logic && component[expression.logic.type];
|
package/dist/Filter.styles.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { Body, Footer } from '@synerise/ds-step-card/dist/StepCard.styles';
|
|
2
|
+
import { Body, DragIcon, Footer } from '@synerise/ds-step-card/dist/StepCard.styles';
|
|
3
3
|
export var FilterWrapper = styled.div.withConfig({
|
|
4
4
|
displayName: "Filterstyles__FilterWrapper",
|
|
5
5
|
componentId: "w5f27p-0"
|
|
6
|
-
})(["display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:
|
|
6
|
+
})(["display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:100%;"]);
|
|
7
7
|
export var MatchingWrapper = styled.div.withConfig({
|
|
8
8
|
displayName: "Filterstyles__MatchingWrapper",
|
|
9
9
|
componentId: "w5f27p-1"
|
|
@@ -11,16 +11,16 @@ export var MatchingWrapper = styled.div.withConfig({
|
|
|
11
11
|
export var LogicWrapper = styled.div.withConfig({
|
|
12
12
|
displayName: "Filterstyles__LogicWrapper",
|
|
13
13
|
componentId: "w5f27p-2"
|
|
14
|
-
})(["margin
|
|
14
|
+
})(["margin:22px 0;"]);
|
|
15
15
|
export var ExpressionWrapper = styled.div.withConfig({
|
|
16
16
|
displayName: "Filterstyles__ExpressionWrapper",
|
|
17
17
|
componentId: "w5f27p-3"
|
|
18
|
-
})(["width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;z-index:", ";&.sortable-chosen{cursor:grabbing;width:100%;opacity:1 !important;height:50px;display:flex;align-items:center;justify-content:center;padding:0;box-shadow:0 16px 32px 0 #23293619;", "{display:none;}", "{display:none;}", "{display:none;}}&.ghost-element{cursor:grabbing;width:100%;background-color:", ";border:
|
|
18
|
+
})(["width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;z-index:", ";&.sortable-chosen{cursor:grabbing;width:100%;opacity:1 !important;height:50px;display:flex;align-items:center;justify-content:center;padding:0;box-shadow:0 16px 32px 0 #23293619;", "{visibility:visible;opacity:1;}", "{display:none;}", "{display:none;}", "{display:none;}}&.ghost-element{cursor:grabbing;width:100%;background-color:", ";border-left:2px solid ", ";border-radius:3px;display:flex;align-items:center;justify-content:center;padding:0;margin-bottom:24px;height:68px;box-shadow:none;position:relative;&:before{content:attr(data-dropLabel);text-align:center;position:relative;color:", ";}*{display:none;}}"], function (props) {
|
|
19
19
|
return 1000 - props.index;
|
|
20
|
-
}, Body, Footer, LogicWrapper, function (props) {
|
|
20
|
+
}, DragIcon, Body, Footer, LogicWrapper, function (props) {
|
|
21
21
|
return props.theme.palette['blue-050'];
|
|
22
22
|
}, function (props) {
|
|
23
|
-
return props.theme.palette['blue-
|
|
23
|
+
return props.theme.palette['blue-600'];
|
|
24
24
|
}, function (props) {
|
|
25
25
|
return props.theme.palette['blue-600'];
|
|
26
26
|
});
|
package/dist/Filter.types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-filter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Filter UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@synerise/ds-button": "^0.17.2",
|
|
36
36
|
"@synerise/ds-icon": "^0.49.0",
|
|
37
|
-
"@synerise/ds-logic": "^0.
|
|
38
|
-
"@synerise/ds-step-card": "^0.
|
|
37
|
+
"@synerise/ds-logic": "^0.7.0",
|
|
38
|
+
"@synerise/ds-step-card": "^0.6.2",
|
|
39
39
|
"react-sortablejs": "^6.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@synerise/ds-step-card": "*",
|
|
44
44
|
"react": ">=16.9.0 < 17.0.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "4a658911645846d1e329609ba9db06a7bc64962b"
|
|
47
47
|
}
|