@configuratorware/configurator-frontendgui 1.29.0 → 1.29.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.
@@ -34,8 +34,9 @@ var ProductPart = function ProductPart(_ref) {
34
34
  selectedOption = _ref.selectedOption,
35
35
  verticalMode = _ref.verticalMode,
36
36
  setAnchorRef = _ref.setAnchorRef,
37
- classes = _ref.classes;
38
- var selected = (0, _get["default"])(selectedOption, 'identifier', null) === (0, _get["default"])(optionclassification, 'identifier', '');
37
+ classes = _ref.classes,
38
+ optionListVisible = _ref.optionListVisible;
39
+ var selected = optionListVisible && (0, _get["default"])(selectedOption, 'identifier', null) === (0, _get["default"])(optionclassification, 'identifier', '');
39
40
  var direction = verticalMode ? 'vertical' : 'horizontal';
40
41
 
41
42
  var displayImage = function displayImage() {
@@ -89,7 +90,8 @@ ProductPart.propTypes = {
89
90
  selectedOption: _propTypes["default"].object,
90
91
  verticalMode: _propTypes["default"].bool,
91
92
  setAnchorRef: _propTypes["default"].func,
92
- classes: _propTypes["default"].object
93
+ classes: _propTypes["default"].object,
94
+ optionListVisible: _propTypes["default"].bool
93
95
  };
94
96
  var StyledProductPart = (0, _styles.withStyles)(function (theme) {
95
97
  var _root, _selected;
@@ -89,7 +89,8 @@ var ProductPartsList = function ProductPartsList(_ref) {
89
89
  vertical = _ref.vertical,
90
90
  ProductPartComponent = _ref.ProductPartComponent,
91
91
  CallToActionComponent = _ref.CallToActionComponent,
92
- width = _ref.width;
92
+ width = _ref.width,
93
+ optionListVisible = _ref.optionListVisible;
93
94
  var classes = useStyles();
94
95
 
95
96
  var _useState = (0, _react.useState)(null),
@@ -111,7 +112,8 @@ var ProductPartsList = function ProductPartsList(_ref) {
111
112
  onSelect: onSelect,
112
113
  optionclassification: option,
113
114
  selectedOption: selectedoptionclassification,
114
- verticalMode: vertical
115
+ verticalMode: vertical,
116
+ optionListVisible: optionListVisible
115
117
  }, refProps));
116
118
  })), showStartHere && width !== 'xs' && /*#__PURE__*/_react["default"].createElement(CallToActionComponent, {
117
119
  offsetDirection: vertical ? 'right' : 'top',
@@ -140,7 +142,8 @@ ProductPartsList.propTypes = {
140
142
  displaySwitchedOptions: _propTypes["default"].bool,
141
143
  ProductPartComponent: _propTypes["default"].elementType,
142
144
  CallToActionComponent: _propTypes["default"].elementType,
143
- width: _propTypes["default"].string
145
+ width: _propTypes["default"].string,
146
+ optionListVisible: _propTypes["default"].bool
144
147
  };
145
148
 
146
149
  var _default = (0, _core.withWidth)({
@@ -36,6 +36,7 @@ var mapStateToProps = function mapStateToProps(_ref2) {
36
36
  optionclassifications: removeHiddenComponents(configurator.filteredOptionclassifications),
37
37
  selectedoptionclassification: configurator.selectedoptionclassification,
38
38
  showStartHere: ui.visibilityMap.startHere,
39
+ optionListVisible: ui.visibilityMap.optionlist,
39
40
  vertical: dock ? dock === 'left' : device.screen.orientation === 'landscape'
40
41
  };
41
42
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-frontendgui",
3
- "version": "1.29.0",
3
+ "version": "1.29.1",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./index.js",
7
7
  "dependencies": {
8
8
  "@babel/polyfill": "^7.12.1",
9
- "@configuratorware/scripts": "1.29.0",
9
+ "@configuratorware/scripts": "1.29.1",
10
10
  "@hot-loader/react-dom": "^17.0.1",
11
11
  "@material-ui/core": "^4.12.2",
12
12
  "@material-ui/icons": "^4.11.2",
@@ -39,8 +39,8 @@
39
39
  "react-router-dom": "^5.2.0",
40
40
  "react-swipeable": "^5.5.1",
41
41
  "react-zoom-pan-pinch": "^2.1.3",
42
- "redhotmagma-graphics-editor": "1.29.0",
43
- "redhotmagma-visualization": "1.29.0",
42
+ "redhotmagma-graphics-editor": "1.29.1",
43
+ "redhotmagma-visualization": "1.29.1",
44
44
  "redux": "^4.1.0",
45
45
  "redux-logger": "^3.0.6",
46
46
  "redux-persist": "^5.10.0",
@@ -2,20 +2,20 @@
2
2
 
3
3
  exports[`ProductPart renders with horizontal marker 1`] = `
4
4
  <div
5
- class="ProductPart-root-11 horizontal custom-css-component"
5
+ class="ProductPart-root-16 horizontal custom-css-component"
6
6
  >
7
7
  <div
8
- class="ProductPart-marker-14 horizontal selected"
8
+ class="ProductPart-marker-19 horizontal selected"
9
9
  />
10
10
  <div
11
- class="ProductPart-content-12 horizontal"
11
+ class="ProductPart-content-17 horizontal"
12
12
  >
13
13
  <i
14
- class="ProductPart-icon-13 horizontal"
14
+ class="ProductPart-icon-18 horizontal"
15
15
  style="background-image:url(/images/components/seat.png)"
16
16
  />
17
17
  <span
18
- class="MuiTypography-root ProductPart-rootTypography-15 MuiTypography-body1"
18
+ class="MuiTypography-root ProductPart-rootTypography-20 MuiTypography-body1"
19
19
  >
20
20
  Seat
21
21
  </span>
@@ -25,20 +25,20 @@ exports[`ProductPart renders with horizontal marker 1`] = `
25
25
 
26
26
  exports[`ProductPart renders with vertical marker 1`] = `
27
27
  <div
28
- class="ProductPart-root-6 vertical custom-css-component"
28
+ class="ProductPart-root-11 vertical custom-css-component"
29
29
  >
30
30
  <div
31
- class="ProductPart-marker-9 vertical selected"
31
+ class="ProductPart-marker-14 vertical selected"
32
32
  />
33
33
  <div
34
- class="ProductPart-content-7 vertical"
34
+ class="ProductPart-content-12 vertical"
35
35
  >
36
36
  <i
37
- class="ProductPart-icon-8 vertical"
37
+ class="ProductPart-icon-13 vertical"
38
38
  style="background-image:url(/images/components/seat.png)"
39
39
  />
40
40
  <span
41
- class="MuiTypography-root ProductPart-rootTypography-10 MuiTypography-body1"
41
+ class="MuiTypography-root ProductPart-rootTypography-15 MuiTypography-body1"
42
42
  >
43
43
  Seat
44
44
  </span>
@@ -68,3 +68,26 @@ exports[`ProductPart renders without marker 1`] = `
68
68
  </div>
69
69
  </div>
70
70
  `;
71
+
72
+ exports[`ProductPart renders without marker when menu is closed 1`] = `
73
+ <div
74
+ class="ProductPart-root-6 vertical custom-css-component"
75
+ >
76
+ <div
77
+ class="ProductPart-marker-9 vertical "
78
+ />
79
+ <div
80
+ class="ProductPart-content-7 vertical"
81
+ >
82
+ <i
83
+ class="ProductPart-icon-8 vertical"
84
+ style="background-image:url(/images/components/seat.png)"
85
+ />
86
+ <span
87
+ class="MuiTypography-root ProductPart-rootTypography-10 MuiTypography-body1"
88
+ >
89
+ Seat
90
+ </span>
91
+ </div>
92
+ </div>
93
+ `;
@@ -16,8 +16,11 @@ const ProductPart = ({
16
16
  verticalMode,
17
17
  setAnchorRef,
18
18
  classes,
19
+ optionListVisible,
19
20
  }) => {
20
- const selected = get(selectedOption, 'identifier', null) === get(optionclassification, 'identifier', '');
21
+ const selected =
22
+ optionListVisible &&
23
+ get(selectedOption, 'identifier', null) === get(optionclassification, 'identifier', '');
21
24
  const direction = verticalMode ? 'vertical' : 'horizontal';
22
25
 
23
26
  const displayImage = () => {
@@ -78,6 +81,7 @@ ProductPart.propTypes = {
78
81
  verticalMode: PropTypes.bool,
79
82
  setAnchorRef: PropTypes.func,
80
83
  classes: PropTypes.object,
84
+ optionListVisible: PropTypes.bool,
81
85
  };
82
86
 
83
87
  export const StyledProductPart = withStyles(
@@ -50,12 +50,24 @@ describe('ProductPart', () => {
50
50
  const tree = render(createProductPart(testProductPart));
51
51
  expect(tree).toMatchSnapshot();
52
52
  });
53
+ it('renders without marker when menu is closed', () => {
54
+ const testProductPart = {
55
+ displaySwitchedOptions: initialState.displaySwitchedOptions,
56
+ optionclassification: initialState.optionclassification,
57
+ selectedOption: initialState.selectedOption,
58
+ onSelect: initialState.onSelect,
59
+ optionListVisible: false,
60
+ };
61
+ const tree = render(createProductPart(testProductPart));
62
+ expect(tree).toMatchSnapshot();
63
+ });
53
64
  it('renders with vertical marker', () => {
54
65
  const testProductPart = {
55
66
  displaySwitchedOptions: initialState.displaySwitchedOptions,
56
67
  optionclassification: initialState.optionclassification,
57
68
  selectedOption: initialState.selectedOption,
58
69
  onSelect: initialState.onSelect,
70
+ optionListVisible: true,
59
71
  };
60
72
  const tree = render(createProductPart(testProductPart));
61
73
  expect(tree).toMatchSnapshot();
@@ -67,6 +79,7 @@ describe('ProductPart', () => {
67
79
  selectedOption: initialState.selectedOption,
68
80
  onSelect: initialState.onSelect,
69
81
  verticalMode: false,
82
+ optionListVisible: true,
70
83
  };
71
84
  const tree = render(createProductPart(testProductPart));
72
85
  expect(tree).toMatchSnapshot();
@@ -50,6 +50,7 @@ const ProductPartsList = ({
50
50
  ProductPartComponent,
51
51
  CallToActionComponent,
52
52
  width,
53
+ optionListVisible,
53
54
  }) => {
54
55
  const classes = useStyles();
55
56
  const [anchorRef, setAnchorRef] = useState(null);
@@ -70,6 +71,7 @@ const ProductPartsList = ({
70
71
  optionclassification={option}
71
72
  selectedOption={selectedoptionclassification}
72
73
  verticalMode={vertical}
74
+ optionListVisible={optionListVisible}
73
75
  {...refProps}
74
76
  />
75
77
  );
@@ -108,6 +110,7 @@ ProductPartsList.propTypes = {
108
110
  ProductPartComponent: PropTypes.elementType,
109
111
  CallToActionComponent: PropTypes.elementType,
110
112
  width: PropTypes.string,
113
+ optionListVisible: PropTypes.bool,
111
114
  };
112
115
 
113
116
  export default withWidth({ initialWidth: 'lg' })(ProductPartsList);
@@ -19,6 +19,7 @@ const mapStateToProps = ({ configurator, device, ui }) => {
19
19
  optionclassifications: removeHiddenComponents(configurator.filteredOptionclassifications),
20
20
  selectedoptionclassification: configurator.selectedoptionclassification,
21
21
  showStartHere: ui.visibilityMap.startHere,
22
+ optionListVisible: ui.visibilityMap.optionlist,
22
23
  vertical: dock ? dock === 'left' : device.screen.orientation === 'landscape',
23
24
  };
24
25
  };