@synerise/ds-filter 0.6.2 → 0.7.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 +33 -0
- package/dist/Filter.js +31 -3
- package/dist/Filter.styles.js +6 -6
- package/dist/Filter.types.d.ts +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
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.7.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.6.4...@synerise/ds-filter@0.7.0) (2022-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix eslint errors ([7cce9b9](https://github.com/Synerise/synerise-design/commit/7cce9b94f8dea533b3c36a0f0cfd5145d4737166))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **filter:** fixes bugs ([b862ddd](https://github.com/Synerise/synerise-design/commit/b862dddbce1293c2a5381663fc903bb574edd135))
|
|
17
|
+
* **filter:** updates styles ([a826761](https://github.com/Synerise/synerise-design/commit/a826761de845a47f8436d22a7307f2c03bb197e0))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [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)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @synerise/ds-filter
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## [0.6.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.6.2...@synerise/ds-filter@0.6.3) (2022-03-24)
|
|
32
|
+
|
|
33
|
+
**Note:** Version bump only for package @synerise/ds-filter
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [0.6.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.6.1...@synerise/ds-filter@0.6.2) (2022-03-24)
|
|
7
40
|
|
|
8
41
|
**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,
|
|
@@ -95,7 +96,34 @@ var Filter = function Filter(_ref) {
|
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
98
|
}, [formatMessage, texts]);
|
|
99
|
+
var getContextTypeTexts = React.useCallback(function (expression) {
|
|
100
|
+
var contextType = expression.expressionType;
|
|
101
|
+
return {
|
|
102
|
+
matching: contextType === 'attribute' ? formatMessage({
|
|
103
|
+
id: 'DS.MATCHING.HAVE',
|
|
104
|
+
defaultMessage: 'Have'
|
|
105
|
+
}) : formatMessage({
|
|
106
|
+
id: 'DS.MATCHING.PERFORMED',
|
|
107
|
+
defaultMessage: 'Performed'
|
|
108
|
+
}),
|
|
109
|
+
notMatching: contextType === 'attribute' ? formatMessage({
|
|
110
|
+
id: 'DS.MATCHING.NOT-HAVE',
|
|
111
|
+
defaultMessage: 'Not have'
|
|
112
|
+
}) : formatMessage({
|
|
113
|
+
id: 'DS.MATCHING.NOT-PERFORMED',
|
|
114
|
+
defaultMessage: 'Not performed'
|
|
115
|
+
}),
|
|
116
|
+
conditionType: contextType === 'attribute' ? formatMessage({
|
|
117
|
+
id: 'DS.MATCHING.EXPRESSION-TYPE.ATTRIBUTE',
|
|
118
|
+
defaultMessage: 'attribute'
|
|
119
|
+
}) : formatMessage({
|
|
120
|
+
id: 'DS.MATCHING.EXPRESSION-TYPE.EVENT',
|
|
121
|
+
defaultMessage: 'event'
|
|
122
|
+
})
|
|
123
|
+
};
|
|
124
|
+
}, [formatMessage]);
|
|
98
125
|
var componentProps = React.useCallback(function (expression) {
|
|
126
|
+
var contextTypeTexts = getContextTypeTexts(expression);
|
|
99
127
|
var props = {
|
|
100
128
|
LOGIC: {
|
|
101
129
|
onChange: function onChange(value) {
|
|
@@ -117,11 +145,11 @@ var Filter = function Filter(_ref) {
|
|
|
117
145
|
},
|
|
118
146
|
footer: renderStepFooter && renderStepFooter(expression),
|
|
119
147
|
children: renderStepContent && renderStepContent(expression),
|
|
120
|
-
texts: text.step
|
|
148
|
+
texts: _objectSpread({}, text.step, {}, contextTypeTexts)
|
|
121
149
|
}
|
|
122
150
|
};
|
|
123
151
|
return props[expression.type];
|
|
124
|
-
}, [onChangeLogic, onChangeStepMatching, onChangeStepName, onDeleteStep, onDuplicateStep, renderStepContent, renderStepFooter, text]);
|
|
152
|
+
}, [getContextTypeTexts, onChangeLogic, onChangeStepMatching, onChangeStepName, onDeleteStep, onDuplicateStep, renderStepContent, renderStepFooter, text.step]);
|
|
125
153
|
var renderExpression = React.useCallback(function (expression, index) {
|
|
126
154
|
var Component = component[expression.type];
|
|
127
155
|
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.7.0",
|
|
4
4
|
"description": "Filter UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-button": "^0.17.
|
|
36
|
-
"@synerise/ds-icon": "^0.
|
|
37
|
-
"@synerise/ds-logic": "^0.
|
|
38
|
-
"@synerise/ds-step-card": "^0.
|
|
35
|
+
"@synerise/ds-button": "^0.17.2",
|
|
36
|
+
"@synerise/ds-icon": "^0.49.0",
|
|
37
|
+
"@synerise/ds-logic": "^0.7.0",
|
|
38
|
+
"@synerise/ds-step-card": "^0.6.0",
|
|
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": "5793ce09feb88b36cc8ca1923ddfcb272b889cb0"
|
|
47
47
|
}
|