@synerise/ds-filter 0.13.4 → 0.14.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 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.14.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.14.0...@synerise/ds-filter@0.14.1) (2023-01-02)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-filter
9
+
10
+
11
+
12
+
13
+
14
+ # [0.14.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.13.4...@synerise/ds-filter@0.14.0) (2022-12-13)
15
+
16
+
17
+ ### Features
18
+
19
+ * **filter:** readOnly state for conditions ([dfa4db3](https://github.com/Synerise/synerise-design/commit/dfa4db35826c0800859b7217dd1ea2f1497ac3c9))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.13.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-filter@0.13.3...@synerise/ds-filter@0.13.4) (2022-12-07)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-filter
package/dist/Filter.js CHANGED
@@ -49,7 +49,9 @@ var Filter = function Filter(_ref) {
49
49
  _ref$visibilityConfig = _ref.visibilityConfig,
50
50
  visibilityConfig = _ref$visibilityConfig === void 0 ? {
51
51
  isStepCardHeaderVisible: true
52
- } : _ref$visibilityConfig;
52
+ } : _ref$visibilityConfig,
53
+ _ref$readOnly = _ref.readOnly,
54
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly;
53
55
  var previousExpressions = usePrevious(expressions);
54
56
 
55
57
  var _React$useState = React.useState(null),
@@ -199,22 +201,27 @@ var Filter = function Filter(_ref) {
199
201
  key: expression.id,
200
202
  "data-dropLabel": text.dropMeHere,
201
203
  index: index,
202
- style: isActive(expression) ? {
204
+ style: !readOnly && isActive(expression) ? {
203
205
  zIndex: 10001
204
206
  } : undefined,
205
207
  onClick: function onClick() {
206
208
  return setActiveExpressionId(expression.id);
207
209
  }
208
- }, /*#__PURE__*/React.createElement(Component, _extends({}, expression.data, componentProps(expression))), expression.logic && index + 1 < expressions.length && /*#__PURE__*/React.createElement(S.LogicWrapper, null, /*#__PURE__*/React.createElement(LogicComponent, _extends({}, expression.logic.data, componentProps(expression.logic)))));
209
- }, [text.dropMeHere, isActive, componentProps, expressions.length]);
210
+ }, /*#__PURE__*/React.createElement(Component, _extends({}, expression.data, componentProps(expression), {
211
+ readOnly: readOnly
212
+ })), expression.logic && index + 1 < expressions.length && /*#__PURE__*/React.createElement(S.LogicWrapper, null, /*#__PURE__*/React.createElement(LogicComponent, _extends({}, expression.logic.data, componentProps(expression.logic), {
213
+ readOnly: readOnly
214
+ }))));
215
+ }, [text.dropMeHere, isActive, componentProps, expressions.length, readOnly]);
210
216
  return /*#__PURE__*/React.createElement(S.FilterWrapper, null, texts != null && (_texts$overwritten = texts.overwritten) != null && _texts$overwritten.filterTitle ? /*#__PURE__*/React.createElement(S.FilterTitle, null, texts.overwritten.filterTitle) : /*#__PURE__*/React.createElement(MatchingWrapper, null, /*#__PURE__*/React.createElement("div", null, matching && /*#__PURE__*/React.createElement(Matching, _extends({}, matching, {
211
- texts: text.matching
217
+ texts: text.matching,
218
+ readOnly: readOnly
212
219
  }))), !!maxConditionsLimit && /*#__PURE__*/React.createElement(S.ConditionsLimit, null, text.conditionsLimit, ":", ' ', /*#__PURE__*/React.createElement(S.ConditionsLimitResults, null, expressions.length, "/", maxConditionsLimit))), /*#__PURE__*/React.createElement(React.Fragment, null, expressions.length > 0 ? /*#__PURE__*/React.createElement(ReactSortable, _extends({}, SORTABLE_CONFIG, {
213
220
  list: expressions,
214
221
  setList: onChangeOrder
215
222
  }), expressions.map(renderExpression)) : /*#__PURE__*/React.createElement(Placeholder, {
216
223
  text: text.placeholder.chooseCondition
217
- })), addFilterComponent && /*#__PURE__*/React.createElement(S.AddButtonWrapper, null, typeof addFilterComponent === 'function' ? addFilterComponent({
224
+ })), addFilterComponent && !readOnly && /*#__PURE__*/React.createElement(S.AddButtonWrapper, null, typeof addFilterComponent === 'function' ? addFilterComponent({
218
225
  isLimitExceeded: isLimitExceeded
219
226
  }) : addFilterComponent));
220
227
  };
@@ -32,6 +32,7 @@ export declare type FilterProps = {
32
32
  renderStepContent?: (expression: Expression, hoverDisabled?: boolean) => React.ReactNode;
33
33
  addFilterComponent?: React.ReactNode | ((arg: addFilterComponentProps) => React.ReactNode);
34
34
  logicOptions?: LogicOperator[];
35
+ readOnly?: boolean;
35
36
  texts?: {
36
37
  matching?: MatchingTexts;
37
38
  step?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-filter",
3
- "version": "0.13.4",
3
+ "version": "0.14.1",
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.10",
36
36
  "@synerise/ds-icon": "^0.52.0",
37
- "@synerise/ds-logic": "^0.7.9",
38
- "@synerise/ds-step-card": "^0.7.25",
37
+ "@synerise/ds-logic": "^0.8.0",
38
+ "@synerise/ds-step-card": "^0.8.1",
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": "b4dad7d512a7658ef4cca191486f10fa2344ab3b"
46
+ "gitHead": "dc78070c73476c9959230e11a5ae020d413e5c16"
47
47
  }