@configuratorware/configurator-frontendgui 1.36.0-beta.0 → 1.36.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/App/Modules/Creator/Components/Option/index.js +7 -1
- package/App/Modules/Creator/Components/Optiondetail/index.js +17 -14
- package/App/Modules/Creator/CreatorScreen.js +1 -4
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +20 -4
- package/App/Modules/Designer/DesignerScreen.js +1 -4
- package/App/Reducers/Configurator/Reducer.js +1 -1
- package/App/Reducers/DesignArea/Selectors.js +31 -13
- package/App/Shared/Components/AmountPrice/index.js +18 -6
- package/Framework/Components/Carousel/index.js +17 -20
- package/package.json +23 -16
- package/src/App/Modules/Creator/Components/Option/index.js +8 -1
- package/src/App/Modules/Creator/Components/Optiondetail/__snapshots__/index.test.js.snap +75 -69
- package/src/App/Modules/Creator/Components/Optiondetail/index.js +50 -45
- package/src/App/Modules/Creator/CreatorScreen.js +0 -2
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +20 -5
- package/src/App/Modules/Designer/DesignerScreen.js +0 -2
- package/src/App/Reducers/Configurator/Reducer.js +4 -1
- package/src/App/Reducers/DesignArea/Selectors.js +15 -0
- package/src/App/Reducers/DesignArea/__tests__/Selectors.test.js +5 -0
- package/src/App/Services/__tests__/DesignDataService.test.js +81 -0
- package/src/App/Shared/Components/AmountPrice/index.js +32 -21
- package/src/Framework/Components/Carousel/index.js +16 -17
- package/Shared/Components/Swipeable.js +0 -57
- package/src/Shared/Components/Swipeable.js +0 -10
|
@@ -309,6 +309,10 @@ var Option = function Option(_ref) {
|
|
|
309
309
|
}));
|
|
310
310
|
};
|
|
311
311
|
|
|
312
|
+
var onAbstractClicked = function onAbstractClicked(event) {
|
|
313
|
+
event.stopPropagation();
|
|
314
|
+
};
|
|
315
|
+
|
|
312
316
|
var onDetailsClicked = function onDetailsClicked(event) {
|
|
313
317
|
event.stopPropagation();
|
|
314
318
|
event.preventDefault();
|
|
@@ -450,7 +454,8 @@ var Option = function Option(_ref) {
|
|
|
450
454
|
}, option.title), hasTextinput && renderTextInput(), !hidePrices && /*#__PURE__*/_react["default"].createElement("div", {
|
|
451
455
|
className: classes.price
|
|
452
456
|
}, option.priceFormatted), smallerScreen && renderControls('horizontal'), option["abstract"] && /*#__PURE__*/_react["default"].createElement(_Markdown["default"], {
|
|
453
|
-
className: classes.description
|
|
457
|
+
className: classes.description,
|
|
458
|
+
onClick: onAbstractClicked
|
|
454
459
|
}, option["abstract"]), renderActions()));
|
|
455
460
|
};
|
|
456
461
|
|
|
@@ -508,6 +513,7 @@ var Option = function Option(_ref) {
|
|
|
508
513
|
onOptionSelected: onOptionSelected,
|
|
509
514
|
onOptionClicked: onOptionClicked,
|
|
510
515
|
onAmountChanged: onAmountChanged,
|
|
516
|
+
onAbstractClicked: onAbstractClicked,
|
|
511
517
|
onDetailsClicked: onDetailsClicked,
|
|
512
518
|
onIncompatibilityClicked: onIncompatibilityClicked,
|
|
513
519
|
onOptionGroupClicked: onOptionGroupClicked,
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
13
|
|
|
14
|
+
var _reactSwipeable = require("react-swipeable");
|
|
15
|
+
|
|
14
16
|
var _clsx2 = _interopRequireDefault(require("clsx"));
|
|
15
17
|
|
|
16
18
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
@@ -43,8 +45,6 @@ var _Markdown = _interopRequireDefault(require("../../../../../Framework/Compone
|
|
|
43
45
|
|
|
44
46
|
var _ZoomImage = _interopRequireDefault(require("./ZoomImage"));
|
|
45
47
|
|
|
46
|
-
var _Swipeable = require("../../../../../Shared/Components/Swipeable");
|
|
47
|
-
|
|
48
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
49
49
|
|
|
50
50
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -214,11 +214,14 @@ var Optiondetail = /*#__PURE__*/function (_React$Component) {
|
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
|
|
217
|
-
_defineProperty(_assertThisInitialized(_this), "swiped", function (e) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
_defineProperty(_assertThisInitialized(_this), "swiped", function (e, deltaX, deltaY) {
|
|
218
|
+
// use only horizontal swiping
|
|
219
|
+
if (Math.abs(deltaX) >= Math.abs(deltaY)) {
|
|
220
|
+
if (deltaX > 0) {
|
|
221
|
+
_this.next();
|
|
222
|
+
} else {
|
|
223
|
+
_this.prev();
|
|
224
|
+
}
|
|
222
225
|
}
|
|
223
226
|
});
|
|
224
227
|
|
|
@@ -425,12 +428,12 @@ var Optiondetail = /*#__PURE__*/function (_React$Component) {
|
|
|
425
428
|
}
|
|
426
429
|
}, /*#__PURE__*/_react["default"].createElement(LoadingComponent, {
|
|
427
430
|
show: loading
|
|
428
|
-
})) : /*#__PURE__*/_react["default"].createElement(
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
431
|
+
})) : /*#__PURE__*/_react["default"].createElement(_reactSwipeable.Swipeable, {
|
|
432
|
+
disabled: !showNav,
|
|
433
|
+
trackMouse: true,
|
|
434
|
+
onSwiped: this.swiped,
|
|
435
|
+
delta: Optiondetail.swipeDelta
|
|
436
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
434
437
|
ref: this.setDetailsContainerRef,
|
|
435
438
|
className: showNav ? classes.detailContainerWithNav : classes.detailContainer
|
|
436
439
|
}, showNav && /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -450,7 +453,7 @@ var Optiondetail = /*#__PURE__*/function (_React$Component) {
|
|
|
450
453
|
})), detailsContent) : detailsContent, showNav && /*#__PURE__*/_react["default"].createElement("div", {
|
|
451
454
|
className: (0, _clsx2["default"])(classes.detailNav, 'next'),
|
|
452
455
|
onClick: this.next
|
|
453
|
-
}))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
456
|
+
})))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
454
457
|
className: classes.detailFooter
|
|
455
458
|
}, this.renderControls())), /*#__PURE__*/_react["default"].createElement(_ZoomImage["default"], {
|
|
456
459
|
onClose: this.toggleZoomImage,
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.CreatorScreen = CreatorScreen;
|
|
9
|
-
exports["default"] = void 0;
|
|
10
9
|
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
11
|
|
|
@@ -305,6 +304,4 @@ CreatorScreen.defaultProps = {
|
|
|
305
304
|
},
|
|
306
305
|
Layout: _DefaultLayout["default"],
|
|
307
306
|
OptionsListContainer: _OptionsList["default"]
|
|
308
|
-
};
|
|
309
|
-
var _default = CreatorScreen;
|
|
310
|
-
exports["default"] = _default;
|
|
307
|
+
};
|
package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js
CHANGED
|
@@ -41,6 +41,8 @@ var _i18n = require("../../../../../Framework/i18n");
|
|
|
41
41
|
|
|
42
42
|
var _Transformers = require("../../Utils/Transformers");
|
|
43
43
|
|
|
44
|
+
var _reactRedux = require("react-redux");
|
|
45
|
+
|
|
44
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
45
47
|
|
|
46
48
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -196,7 +198,8 @@ var DesignerSelectionToolbox = function DesignerSelectionToolbox(props) {
|
|
|
196
198
|
addCustomFont = props.addCustomFont,
|
|
197
199
|
defaultFont = props.defaultFont,
|
|
198
200
|
loadFonts = props.loadFonts,
|
|
199
|
-
initialColor = props.initialColor
|
|
201
|
+
initialColor = props.initialColor,
|
|
202
|
+
autoFocusEditor = props.autoFocusEditor;
|
|
200
203
|
var rteRef = (0, _react.useRef)(null);
|
|
201
204
|
var editorRef = (0, _react.useRef)(null);
|
|
202
205
|
|
|
@@ -205,6 +208,9 @@ var DesignerSelectionToolbox = function DesignerSelectionToolbox(props) {
|
|
|
205
208
|
showCustomFontOverlay = _useState2[0],
|
|
206
209
|
toggleCustomFontOverlay = _useState2[1];
|
|
207
210
|
|
|
211
|
+
var disableLinebreaks = (0, _reactRedux.useSelector)(function (state) {
|
|
212
|
+
return (0, _Selectors.isOneLineText)(state);
|
|
213
|
+
});
|
|
208
214
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
209
215
|
className: classes.root
|
|
210
216
|
}, /*#__PURE__*/_react["default"].createElement(_SelectionToolbox["default"], null, function (_ref) {
|
|
@@ -312,6 +318,13 @@ var DesignerSelectionToolbox = function DesignerSelectionToolbox(props) {
|
|
|
312
318
|
if ((0, _Selectors.isPlaceholderContent)(selectedObject.content)) {
|
|
313
319
|
canvas.selectedObject.content = '';
|
|
314
320
|
}
|
|
321
|
+
},
|
|
322
|
+
onBlur: function onBlur() {
|
|
323
|
+
var regex = /<\/span>/;
|
|
324
|
+
|
|
325
|
+
if (selectedObject.content.search(regex) === -1) {
|
|
326
|
+
canvas.selectedObject.remove();
|
|
327
|
+
}
|
|
315
328
|
}
|
|
316
329
|
};
|
|
317
330
|
|
|
@@ -323,7 +336,8 @@ var DesignerSelectionToolbox = function DesignerSelectionToolbox(props) {
|
|
|
323
336
|
}
|
|
324
337
|
|
|
325
338
|
return renderTextEditor(_objectSpread(_objectSpread({}, textToolsRenderObj), {}, {
|
|
326
|
-
|
|
339
|
+
disableLinebreaks: disableLinebreaks,
|
|
340
|
+
autoFocusWhenMounted: autoFocusEditor || !((0, _Selectors.isPlaceholderContent)(selectedObject.content) || (0, _isMobileDevice["default"])()),
|
|
327
341
|
textEditorElementProps: textEditorElementProps,
|
|
328
342
|
onChangeHTML: function onChangeHTML() {
|
|
329
343
|
// call the original function first with all the args
|
|
@@ -404,7 +418,8 @@ DesignerSelectionToolbox.propTypes = {
|
|
|
404
418
|
calculateTextEditorBackgroundColor: _propTypes["default"].func,
|
|
405
419
|
addCustomFont: _propTypes["default"].func,
|
|
406
420
|
defaultFont: _propTypes["default"].object,
|
|
407
|
-
initialColor: _propTypes["default"].object
|
|
421
|
+
initialColor: _propTypes["default"].object,
|
|
422
|
+
autoFocusEditor: _propTypes["default"].bool
|
|
408
423
|
};
|
|
409
424
|
DesignerSelectionToolbox.defaultProps = {
|
|
410
425
|
TextControlboxComponent: _TextControlbox["default"],
|
|
@@ -415,7 +430,8 @@ DesignerSelectionToolbox.defaultProps = {
|
|
|
415
430
|
classes: {},
|
|
416
431
|
width: '',
|
|
417
432
|
isActiveBulkName: false,
|
|
418
|
-
isPortraitMode: false
|
|
433
|
+
isPortraitMode: false,
|
|
434
|
+
autoFocusEditor: false
|
|
419
435
|
};
|
|
420
436
|
|
|
421
437
|
var _default = (0, _withWidth["default"])()((0, _withStyles["default"])(styles, {
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.DesignerScreen = DesignerScreen;
|
|
9
|
-
exports["default"] = void 0;
|
|
10
9
|
|
|
11
10
|
var React = _interopRequireWildcard(require("react"));
|
|
12
11
|
|
|
@@ -253,6 +252,4 @@ DesignerScreen.defaultProps = {
|
|
|
253
252
|
TextEditorStateProvider: _DefaultCanvasProvider.DefaultTextEditorStateProvider,
|
|
254
253
|
Layout: _DefaultLayout["default"],
|
|
255
254
|
PopupArea: _PopupAreaProvider.PopupArea
|
|
256
|
-
};
|
|
257
|
-
var _default = DesignerScreen;
|
|
258
|
-
exports["default"] = _default;
|
|
255
|
+
};
|
|
@@ -667,6 +667,6 @@ function configuratorReducer() {
|
|
|
667
667
|
|
|
668
668
|
function filterOptionsWithDetails(options) {
|
|
669
669
|
return _lodash["default"].filter(options, function (option) {
|
|
670
|
-
return !!(option["abstract"] || option.description || option.
|
|
670
|
+
return !!(option["abstract"] || option.description || option.detailImageExists === true);
|
|
671
671
|
});
|
|
672
672
|
}
|
|
@@ -62,6 +62,7 @@ var _exportNames = {
|
|
|
62
62
|
parseColorData: true,
|
|
63
63
|
getCameraViewListForDesignAreaList: true,
|
|
64
64
|
getDesignViewListForDesignAreas: true,
|
|
65
|
+
getDesignAreaFromSelectedDesignView: true,
|
|
65
66
|
getDefaultDesignAreaIdentifierFromProductionMethod: true,
|
|
66
67
|
getDefaultColorsFromDesignProductionMethod: true,
|
|
67
68
|
getDefaultTextColor: true,
|
|
@@ -76,7 +77,8 @@ var _exportNames = {
|
|
|
76
77
|
getDesignAreaPreSelection: true,
|
|
77
78
|
getDesignAreaColorAmount: true,
|
|
78
79
|
getVectorizeForDesignProductionMethods: true,
|
|
79
|
-
getImagesByDesignArea: true
|
|
80
|
+
getImagesByDesignArea: true,
|
|
81
|
+
isOneLineText: true
|
|
80
82
|
};
|
|
81
83
|
exports.getDesignProductionMethods = getDesignProductionMethods;
|
|
82
84
|
exports.getDesignDataByDesignAreaIdentifier = getDesignDataByDesignAreaIdentifier;
|
|
@@ -122,13 +124,14 @@ exports.getColorsWithPalette = getColorsWithPalette;
|
|
|
122
124
|
exports.getColorsFromCanvasData = getColorsFromCanvasData;
|
|
123
125
|
exports.getColorsFromCanvasDataWithPalette = getColorsFromCanvasDataWithPalette;
|
|
124
126
|
exports.findSmallestFontSizeInCanvasData = findSmallestFontSizeInCanvasData;
|
|
125
|
-
exports.
|
|
127
|
+
exports.isOneLineText = isOneLineText;
|
|
128
|
+
exports.getImagesByDesignArea = exports.getVectorizeForDesignProductionMethods = exports.getDesignAreaColorAmount = exports.getDesignAreaPreSelection = exports.hasLastEditedDesignArea = exports.areAllDesignAreasEmpty = exports.getVectorizedImageColor = exports.areHashesCompatible = exports.getCurrentCompatibilityInfoHash = exports.getDesignAreaImageCompatibilityInfo = exports.contentHasText = exports.isPlaceholderContent = exports.getDefaultTextColor = exports.getDefaultColorsFromDesignProductionMethod = exports.getDefaultDesignAreaIdentifierFromProductionMethod = exports.getDesignAreaFromSelectedDesignView = exports.getDesignViewListForDesignAreas = exports.getCameraViewListForDesignAreaList = exports.parseColorData = exports.createColorData = exports.rgbObjToHex = exports.rgbString2hex = exports.rgbToHex = exports.calculateColorDistance = exports.hexToRgbNumbers = exports.hexToRgb = exports.isValidHex = exports.getColorPalettes = exports.hasPlaceHolderImagesForActiveDesignArea = exports.getDesignAreaIdentifierToOpen = void 0;
|
|
126
129
|
|
|
127
130
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
128
131
|
|
|
129
132
|
var _first = _interopRequireDefault(require("lodash/first"));
|
|
130
133
|
|
|
131
|
-
var
|
|
134
|
+
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
132
135
|
|
|
133
136
|
var _findKey = _interopRequireDefault(require("lodash/findKey"));
|
|
134
137
|
|
|
@@ -348,8 +351,9 @@ var getDesignAreaIdentifierToOpen = function getDesignAreaIdentifierToOpen(state
|
|
|
348
351
|
var identifier = state.designArea.selectedDesignArea.identifier;
|
|
349
352
|
var previousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier(state);
|
|
350
353
|
var firstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData(state);
|
|
354
|
+
var designAreaFromSelectedDesignView = getDesignAreaFromSelectedDesignView(state);
|
|
351
355
|
var defaultDesignAreaFromProductionMethod = getDefaultDesignAreaIdentifierFromProductionMethod(state);
|
|
352
|
-
return identifier || previousEditedDesignAreaIdentifier || firstEditedDesignAreafromDesignData || defaultDesignAreaFromProductionMethod || null;
|
|
356
|
+
return identifier || previousEditedDesignAreaIdentifier || firstEditedDesignAreafromDesignData || designAreaFromSelectedDesignView || defaultDesignAreaFromProductionMethod || null;
|
|
353
357
|
};
|
|
354
358
|
|
|
355
359
|
exports.getDesignAreaIdentifierToOpen = getDesignAreaIdentifierToOpen;
|
|
@@ -386,7 +390,7 @@ function getSelectedDesignProductionMethod(state) {
|
|
|
386
390
|
var designProductionMethods = getDesignProductionMethods(state);
|
|
387
391
|
var designAreaData = getDesignDataForSelectedDesignArea(state);
|
|
388
392
|
var designProductionMethodIdentifier = designAreaData.designProductionMethodIdentifier;
|
|
389
|
-
return (0,
|
|
393
|
+
return (0, _find2["default"])(designProductionMethods, {
|
|
390
394
|
identifier: designProductionMethodIdentifier
|
|
391
395
|
}) || (0, _first["default"])(designProductionMethods);
|
|
392
396
|
}
|
|
@@ -487,14 +491,14 @@ function getSelectedDesignProductionMethodForDesignArea(state, designArea) {
|
|
|
487
491
|
var _ref8 = designAreaData || {},
|
|
488
492
|
designProductionMethodIdentifier = _ref8.designProductionMethodIdentifier;
|
|
489
493
|
|
|
490
|
-
return (0,
|
|
494
|
+
return (0, _find2["default"])(designProductionMethods, {
|
|
491
495
|
identifier: designProductionMethodIdentifier
|
|
492
496
|
}) || (0, _first["default"])(designProductionMethods);
|
|
493
497
|
}
|
|
494
498
|
|
|
495
499
|
function getDesignProductionMethodByIdentifier(state, identifier) {
|
|
496
500
|
var designProductionMethods = getDesignProductionMethods(state);
|
|
497
|
-
return (0,
|
|
501
|
+
return (0, _find2["default"])(designProductionMethods, {
|
|
498
502
|
identifier: identifier
|
|
499
503
|
});
|
|
500
504
|
}
|
|
@@ -678,7 +682,7 @@ function getEngravingBackgroundColor(state, designProductionMethod) {
|
|
|
678
682
|
var _designProductionMethod = designProductionMethod || getSelectedDesignProductionMethod(state) || {};
|
|
679
683
|
|
|
680
684
|
var engravingBackgroundColors = _designProductionMethod.engravingBackgroundColors;
|
|
681
|
-
return (0, _get["default"])((0,
|
|
685
|
+
return (0, _get["default"])((0, _find2["default"])(engravingBackgroundColors, {
|
|
682
686
|
itemIdentifier: variantIdentifier || (0, _Selectors.getSelectedVariantIdentifier)((0, _Selectors.getConfigurator)(state))
|
|
683
687
|
}), 'colorHex', 'rgba(0, 0, 0, 0.5)');
|
|
684
688
|
}
|
|
@@ -1027,6 +1031,16 @@ var getDesignViewListForDesignAreas = function getDesignViewListForDesignAreas(s
|
|
|
1027
1031
|
|
|
1028
1032
|
exports.getDesignViewListForDesignAreas = getDesignViewListForDesignAreas;
|
|
1029
1033
|
|
|
1034
|
+
var getDesignAreaFromSelectedDesignView = function getDesignAreaFromSelectedDesignView(state) {
|
|
1035
|
+
var _find;
|
|
1036
|
+
|
|
1037
|
+
var filteredDesignAreas = state.designArea.filteredDesignAreas,
|
|
1038
|
+
selectedDesignView = state.designView.selectedDesignView;
|
|
1039
|
+
return (_find = (0, _find2["default"])(filteredDesignAreas, ['designView.identifier', selectedDesignView.identifier])) === null || _find === void 0 ? void 0 : _find.identifier;
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
exports.getDesignAreaFromSelectedDesignView = getDesignAreaFromSelectedDesignView;
|
|
1043
|
+
|
|
1030
1044
|
var getDefaultDesignAreaIdentifierFromProductionMethod = function getDefaultDesignAreaIdentifierFromProductionMethod(state) {
|
|
1031
1045
|
//return the first designArea with isDefault: true due to api call accepts multiple productionmethods to be default
|
|
1032
1046
|
var filteredDesignAreas = state.designArea.filteredDesignAreas;
|
|
@@ -1083,12 +1097,12 @@ var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
|
1083
1097
|
var variantIdentifier = (0, _Selectors.getSelectedVariantIdentifier)((0, _Selectors.getConfigurator)(state));
|
|
1084
1098
|
|
|
1085
1099
|
if (defaultColors && defaultColors[variantIdentifier]) {
|
|
1086
|
-
var colorPalette = (0,
|
|
1100
|
+
var colorPalette = (0, _find2["default"])(colorPalettes, {
|
|
1087
1101
|
identifier: Object.keys(defaultColors[variantIdentifier])[0]
|
|
1088
1102
|
});
|
|
1089
1103
|
|
|
1090
1104
|
if (colorPalette) {
|
|
1091
|
-
var color = (0,
|
|
1105
|
+
var color = (0, _find2["default"])(colorPalette.colors, {
|
|
1092
1106
|
identifier: defaultColors[variantIdentifier][colorPalette.identifier]
|
|
1093
1107
|
});
|
|
1094
1108
|
|
|
@@ -1104,7 +1118,7 @@ var getDefaultTextColor = function getDefaultTextColor(state) {
|
|
|
1104
1118
|
}
|
|
1105
1119
|
|
|
1106
1120
|
var paletteDefaultColorIdentifier = (0, _get["default"])(colorPalettes[0], 'defaultColor.identifier', '');
|
|
1107
|
-
var paletteDefaultColor = (0,
|
|
1121
|
+
var paletteDefaultColor = (0, _find2["default"])(colorPalettes[0].colors, {
|
|
1108
1122
|
identifier: paletteDefaultColorIdentifier
|
|
1109
1123
|
});
|
|
1110
1124
|
|
|
@@ -1254,7 +1268,7 @@ var getDesignAreaPreSelection = function getDesignAreaPreSelection(identifier) {
|
|
|
1254
1268
|
return {};
|
|
1255
1269
|
}
|
|
1256
1270
|
|
|
1257
|
-
var preSelection = (0,
|
|
1271
|
+
var preSelection = (0, _find2["default"])(designerPreSelection.designAreas, {
|
|
1258
1272
|
identifier: identifier
|
|
1259
1273
|
});
|
|
1260
1274
|
return preSelection ? preSelection : {};
|
|
@@ -1301,4 +1315,8 @@ var getImagesByDesignArea = function getImagesByDesignArea(state, designAreaIden
|
|
|
1301
1315
|
});
|
|
1302
1316
|
};
|
|
1303
1317
|
|
|
1304
|
-
exports.getImagesByDesignArea = getImagesByDesignArea;
|
|
1318
|
+
exports.getImagesByDesignArea = getImagesByDesignArea;
|
|
1319
|
+
|
|
1320
|
+
function isOneLineText(state) {
|
|
1321
|
+
return (0, _get["default"])(getSelectedDesignProductionMethod(state), 'oneLineText', false);
|
|
1322
|
+
}
|
|
@@ -358,6 +358,10 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
358
358
|
|
|
359
359
|
_defineProperty(_assertThisInitialized(_this), "priceListRef", /*#__PURE__*/_react["default"].createRef());
|
|
360
360
|
|
|
361
|
+
_defineProperty(_assertThisInitialized(_this), "acceptDesignRef", /*#__PURE__*/_react["default"].createRef());
|
|
362
|
+
|
|
363
|
+
_defineProperty(_assertThisInitialized(_this), "acceptDataPrivacyRef", /*#__PURE__*/_react["default"].createRef());
|
|
364
|
+
|
|
361
365
|
_defineProperty(_assertThisInitialized(_this), "handleChange", function (event) {
|
|
362
366
|
_this.setState(_defineProperty({}, event.target.name, {
|
|
363
367
|
value: event.target.checked,
|
|
@@ -365,7 +369,7 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
365
369
|
}));
|
|
366
370
|
});
|
|
367
371
|
|
|
368
|
-
_defineProperty(_assertThisInitialized(_this), "verifyRequestErrors", function () {
|
|
372
|
+
_defineProperty(_assertThisInitialized(_this), "verifyRequestErrors", function (hasFormValidationErrors) {
|
|
369
373
|
var _this$props = _this.props,
|
|
370
374
|
bulkNameErrors = _this$props.bulkNameErrors,
|
|
371
375
|
displayAcceptDesign = _this$props.displayAcceptDesign;
|
|
@@ -390,6 +394,8 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
390
394
|
error: true
|
|
391
395
|
}
|
|
392
396
|
});
|
|
397
|
+
|
|
398
|
+
!hasFormValidationErrors && _this.acceptDesignRef.current && _this.acceptDesignRef.current.scrollIntoView();
|
|
393
399
|
}
|
|
394
400
|
|
|
395
401
|
if (!_this.dataPrivacyApproved()) {
|
|
@@ -399,6 +405,8 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
399
405
|
error: true
|
|
400
406
|
}
|
|
401
407
|
});
|
|
408
|
+
|
|
409
|
+
!hasFormValidationErrors && _this.acceptDataPrivacyRef.current && _this.acceptDataPrivacyRef.current.scrollIntoView();
|
|
402
410
|
}
|
|
403
411
|
});
|
|
404
412
|
|
|
@@ -523,7 +531,7 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
523
531
|
break;
|
|
524
532
|
|
|
525
533
|
case 9:
|
|
526
|
-
_this.verifyRequestErrors();
|
|
534
|
+
_this.verifyRequestErrors(formValidation.hasError);
|
|
527
535
|
|
|
528
536
|
case 10:
|
|
529
537
|
case "end":
|
|
@@ -799,7 +807,9 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
799
807
|
contactData: (0, _i18n.t)('amountPrice.contactData'),
|
|
800
808
|
handleClose: this.handleClose,
|
|
801
809
|
amount: amount,
|
|
802
|
-
acceptDesignComponent: showCallToAction ? /*#__PURE__*/_react["default"].createElement(
|
|
810
|
+
acceptDesignComponent: showCallToAction ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
811
|
+
ref: this.acceptDesignRef
|
|
812
|
+
}, /*#__PURE__*/_react["default"].createElement(AcceptDesignComponent, {
|
|
803
813
|
termsAndConditionsLink: termsAndConditionsLink,
|
|
804
814
|
displayAcceptDesign: displayAcceptDesign,
|
|
805
815
|
handleChangeCheckboxApproval: this.handleChange,
|
|
@@ -808,15 +818,17 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
808
818
|
notice: notice,
|
|
809
819
|
noteLabel: (0, _i18n.t)('amountPrice.notice'),
|
|
810
820
|
handleChange: this.handleBasketNoticeChange
|
|
811
|
-
}) : null,
|
|
812
|
-
acceptDataPrivacyComponent: showReceiveOfferForm && dataPrivacyLink ? /*#__PURE__*/_react["default"].createElement(
|
|
821
|
+
})) : null,
|
|
822
|
+
acceptDataPrivacyComponent: showReceiveOfferForm && dataPrivacyLink ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
823
|
+
ref: this.acceptDataPrivacyRef
|
|
824
|
+
}, /*#__PURE__*/_react["default"].createElement(AcceptPrivacyComponent, {
|
|
813
825
|
dataPrivacyLink: dataPrivacyLink,
|
|
814
826
|
displayAcceptDesign: true,
|
|
815
827
|
handleChangeCheckboxApproval: this.handleChange,
|
|
816
828
|
approval: dataPrivacyAccepted,
|
|
817
829
|
closeProductOverviewDialog: this.handleClose,
|
|
818
830
|
displayNote: false
|
|
819
|
-
}) : null,
|
|
831
|
+
})) : null,
|
|
820
832
|
notificationComponent: mergedNotifications.map(function (_ref4, key) {
|
|
821
833
|
var message = _ref4.message,
|
|
822
834
|
level = _ref4.level,
|
|
@@ -9,6 +9,8 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
+
var _reactSwipeable = require("react-swipeable");
|
|
13
|
+
|
|
12
14
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
13
15
|
|
|
14
16
|
require("./Styles.scss");
|
|
@@ -19,8 +21,6 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
19
21
|
|
|
20
22
|
var _styles = require("@material-ui/core/styles");
|
|
21
23
|
|
|
22
|
-
var _Swipeable = require("../../../Shared/Components/Swipeable");
|
|
23
|
-
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
25
|
|
|
26
26
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -186,16 +186,18 @@ var Carousel = /*#__PURE__*/function (_React$Component) {
|
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
_defineProperty(_assertThisInitialized(_this), "swiped", function (e) {
|
|
189
|
-
if
|
|
190
|
-
|
|
189
|
+
// if it's vertical deltaY should be the bigger
|
|
190
|
+
if (_this.props.vertical && Math.abs(e.deltaY) >= Math.abs(e.deltaX)) {
|
|
191
|
+
if (e.deltaY > 0) {
|
|
191
192
|
_this.next();
|
|
192
|
-
} else
|
|
193
|
+
} else {
|
|
193
194
|
_this.prev();
|
|
194
195
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
196
|
+
} // if it's not vertical deltaX should be the bigger
|
|
197
|
+
else if (!_this.props.vertical && Math.abs(e.deltaX) >= Math.abs(e.deltaY)) {
|
|
198
|
+
if (e.deltaX > 0) {
|
|
197
199
|
_this.next();
|
|
198
|
-
} else
|
|
200
|
+
} else {
|
|
199
201
|
_this.prev();
|
|
200
202
|
}
|
|
201
203
|
}
|
|
@@ -229,13 +231,10 @@ var Carousel = /*#__PURE__*/function (_React$Component) {
|
|
|
229
231
|
_createClass(Carousel, [{
|
|
230
232
|
key: "componentDidMount",
|
|
231
233
|
value: function componentDidMount() {
|
|
234
|
+
this.init();
|
|
232
235
|
var carousel = this.refs.carousel;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
this.init();
|
|
236
|
-
var wheelEventName = 'onwheel' in carousel ? 'wheel' : 'mousewheel';
|
|
237
|
-
carousel.addEventListener(wheelEventName, this.scrolled);
|
|
238
|
-
}
|
|
236
|
+
var wheelEventName = 'onwheel' in carousel ? 'wheel' : 'mousewheel';
|
|
237
|
+
carousel.addEventListener(wheelEventName, this.scrolled);
|
|
239
238
|
}
|
|
240
239
|
}, {
|
|
241
240
|
key: "componentDidUpdate",
|
|
@@ -279,13 +278,11 @@ var Carousel = /*#__PURE__*/function (_React$Component) {
|
|
|
279
278
|
className: (0, _clsx["default"])(classes.carousel, prevClassName),
|
|
280
279
|
ref: "prev",
|
|
281
280
|
onClick: this.prev
|
|
282
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
281
|
+
}), /*#__PURE__*/_react["default"].createElement(_reactSwipeable.Swipeable, {
|
|
283
282
|
className: 'carousel-frame',
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
onSwiped: this.swiped
|
|
288
|
-
}
|
|
283
|
+
trackMouse: true,
|
|
284
|
+
onSwiping: this.swiping,
|
|
285
|
+
onSwiped: this.swiped
|
|
289
286
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
290
287
|
className: "carousel-slider",
|
|
291
288
|
style: {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configuratorware/configurator-frontendgui",
|
|
3
|
-
"version": "1.36.0
|
|
3
|
+
"version": "1.36.0",
|
|
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.36.0
|
|
10
|
-
"@hot-loader/react-dom": "^17.0.
|
|
9
|
+
"@configuratorware/scripts": "1.36.0",
|
|
10
|
+
"@hot-loader/react-dom": "^17.0.1",
|
|
11
11
|
"@material-ui/core": "^4.12.2",
|
|
12
12
|
"@material-ui/icons": "^4.11.2",
|
|
13
13
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"path-browserify": "^1.0.1",
|
|
27
27
|
"prop-types": "^15.7.2",
|
|
28
28
|
"qs": "^6.10.1",
|
|
29
|
-
"react": "^
|
|
29
|
+
"react": "^16.14.0",
|
|
30
30
|
"react-custom-scrollbars": "^4.2.1",
|
|
31
|
-
"react-dom": "^
|
|
31
|
+
"react-dom": "^16.14.0",
|
|
32
32
|
"react-file-drop": "^0.2.8",
|
|
33
33
|
"react-hot-loader": "^4.13.0",
|
|
34
34
|
"react-hyphen": "^1.4.0",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"react-redux-i18n": "^1.9.3",
|
|
38
38
|
"react-router": "^5.2.0",
|
|
39
39
|
"react-router-dom": "^5.2.0",
|
|
40
|
-
"react-swipeable": "^
|
|
40
|
+
"react-swipeable": "^5.5.1",
|
|
41
41
|
"react-zoom-pan-pinch": "^2.1.3",
|
|
42
|
-
"redhotmagma-graphics-editor": "1.36.0
|
|
43
|
-
"redhotmagma-visualization": "1.36.0
|
|
42
|
+
"redhotmagma-graphics-editor": "1.36.0",
|
|
43
|
+
"redhotmagma-visualization": "1.36.0",
|
|
44
44
|
"redux": "^4.1.0",
|
|
45
45
|
"redux-logger": "^3.0.6",
|
|
46
46
|
"redux-persist": "^5.10.0",
|
|
@@ -52,18 +52,25 @@
|
|
|
52
52
|
"uuid": "^3.4.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
+
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
56
|
+
"@babel/plugin-proposal-decorators": "^7.13.5",
|
|
57
|
+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
58
|
+
"@babel/preset-env": "^7.13.12",
|
|
59
|
+
"@babel/preset-react": "^7.13.13",
|
|
60
|
+
"@babel/preset-typescript": "^7.13.0",
|
|
55
61
|
"babel-loader": "^8.2.2",
|
|
56
|
-
"
|
|
62
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
63
|
+
"css-loader": "^5.2.0",
|
|
57
64
|
"file-loader": "^6.2.0",
|
|
58
|
-
"mini-css-extract-plugin": "^
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
65
|
+
"mini-css-extract-plugin": "^1.4.0",
|
|
66
|
+
"node-sass": "^5.0.0",
|
|
67
|
+
"optimize-css-assets-webpack-plugin": "^5.0.4",
|
|
68
|
+
"resolve-url-loader": "^3.1.2",
|
|
69
|
+
"sass-loader": "^11.0.1",
|
|
62
70
|
"style-loader": "^2.0.0",
|
|
63
|
-
"terser-webpack-plugin": "^5.1.4",
|
|
64
71
|
"url-loader": "^4.1.1",
|
|
65
|
-
"webpack": "^5.
|
|
66
|
-
"webpack-cli": "^4.
|
|
72
|
+
"webpack": "^5.28.0",
|
|
73
|
+
"webpack-cli": "^4.6.0",
|
|
67
74
|
"webpack-dev-server": "^3.11.2"
|
|
68
75
|
},
|
|
69
76
|
"scripts": {
|
|
@@ -253,6 +253,10 @@ const Option = ({ children, render, ...props }) => {
|
|
|
253
253
|
});
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
+
const onAbstractClicked = event => {
|
|
257
|
+
event.stopPropagation();
|
|
258
|
+
};
|
|
259
|
+
|
|
256
260
|
const onDetailsClicked = event => {
|
|
257
261
|
event.stopPropagation();
|
|
258
262
|
event.preventDefault();
|
|
@@ -409,7 +413,9 @@ const Option = ({ children, render, ...props }) => {
|
|
|
409
413
|
{!hidePrices && <div className={classes.price}>{option.priceFormatted}</div>}
|
|
410
414
|
{smallerScreen && renderControls('horizontal')}
|
|
411
415
|
{option.abstract && (
|
|
412
|
-
<Markdown className={classes.description}
|
|
416
|
+
<Markdown className={classes.description} onClick={onAbstractClicked}>
|
|
417
|
+
{option.abstract}
|
|
418
|
+
</Markdown>
|
|
413
419
|
)}
|
|
414
420
|
|
|
415
421
|
{renderActions()}
|
|
@@ -481,6 +487,7 @@ const Option = ({ children, render, ...props }) => {
|
|
|
481
487
|
onOptionSelected,
|
|
482
488
|
onOptionClicked,
|
|
483
489
|
onAmountChanged,
|
|
490
|
+
onAbstractClicked,
|
|
484
491
|
onDetailsClicked,
|
|
485
492
|
onIncompatibilityClicked,
|
|
486
493
|
onOptionGroupClicked,
|