@configuratorware/configurator-frontendgui 1.32.1-beta.2 → 1.32.3
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/Optiondetail/index.js +17 -14
- package/App/Reducers/Configurator/Reducer.js +1 -1
- package/App/Shared/Components/AmountPrice/index.js +1 -1
- package/App/configuration.js +1 -2
- package/Framework/Components/Carousel/index.js +17 -20
- package/package.json +25 -17
- package/src/App/Modules/Creator/Components/Optiondetail/index.js +18 -13
- package/src/App/Reducers/Configurator/Reducer.js +1 -1
- package/src/App/Shared/Components/AmountPrice/index.js +1 -1
- package/src/App/configuration.js +1 -1
- package/src/Framework/Components/Carousel/index.js +16 -17
- package/Shared/Components/Swipeable.js +0 -56
- package/src/Shared/Components/Swipeable.js +0 -9
|
@@ -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,
|
|
@@ -634,6 +634,6 @@ function configuratorReducer() {
|
|
|
634
634
|
|
|
635
635
|
function filterOptionsWithDetails(options) {
|
|
636
636
|
return _lodash["default"].filter(options, function (option) {
|
|
637
|
-
return !!(option["abstract"] || option.description || option.
|
|
637
|
+
return !!(option["abstract"] || option.description || option.detailImageExists === true);
|
|
638
638
|
});
|
|
639
639
|
}
|
|
@@ -431,7 +431,7 @@ var AmountPrice = /*#__PURE__*/function (_React$Component) {
|
|
|
431
431
|
clientTexts = _this$props3.clientTexts;
|
|
432
432
|
var dataPrivacyLink = clientTexts.dataPrivacyLink;
|
|
433
433
|
var dataPrivacyApproved = _this.state.dataPrivacyAccepted.value;
|
|
434
|
-
return showReceiveOfferForm
|
|
434
|
+
return !dataPrivacyLink || !showReceiveOfferForm || dataPrivacyApproved;
|
|
435
435
|
});
|
|
436
436
|
|
|
437
437
|
_defineProperty(_assertThisInitialized(_this), "handleTouchMove", function (evt) {
|
package/App/configuration.js
CHANGED
|
@@ -28,8 +28,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
28
28
|
|
|
29
29
|
var DEVELOPMENT_HOST_INT = 'http://int.configuratorware.local'; // eslint-disable-next-line no-unused-vars
|
|
30
30
|
|
|
31
|
-
var DEVELOPMENT_HOST_LOCAL =
|
|
32
|
-
|
|
31
|
+
var DEVELOPMENT_HOST_LOCAL = 'http://localhost:10030';
|
|
33
32
|
var hostsByNodeEnv = {
|
|
34
33
|
production: '',
|
|
35
34
|
development: DEVELOPMENT_HOST_LOCAL,
|
|
@@ -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.32.
|
|
3
|
+
"version": "1.32.3",
|
|
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.32.
|
|
10
|
-
"@hot-loader/react-dom": "^17.0.
|
|
9
|
+
"@configuratorware/scripts": "1.32.3",
|
|
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.32.
|
|
43
|
-
"redhotmagma-visualization": "1.32.
|
|
42
|
+
"redhotmagma-graphics-editor": "1.32.3",
|
|
43
|
+
"redhotmagma-visualization": "1.32.3",
|
|
44
44
|
"redux": "^4.1.0",
|
|
45
45
|
"redux-logger": "^3.0.6",
|
|
46
46
|
"redux-persist": "^5.10.0",
|
|
@@ -52,22 +52,30 @@
|
|
|
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": {
|
|
70
77
|
"copy-public": "node ./scripts/cpPublic.js",
|
|
71
78
|
"install": "npm run copy-public"
|
|
72
|
-
}
|
|
79
|
+
},
|
|
80
|
+
"readme": "# configurator-frontendgui\n\n## Setup for Development\n1. Follow the \"preparation\", \"install\" and \"start development\" steps in frontend/README.md\n1. Open the core app in the browser: http://localhost:3001/identifier:softshell_designer_2d\n1. 'hostsByNodeEnv.development' in src/App/configuration.js is configurable \n thus allowing to use e.g. your local api\n\n## Ready to build the artifacts\n- run `pnpm build` from project scope (does not build workspace dependencies automatically)\n- or run `pnpm build` from workspace root\n\n## Start storybook in project \n1. `pnpm run storybook`\n1. `storybook starts on http://localhost:9001/` \n\n## [Guidelines for automated testing](docs/TestingGuidelines.md)\n"
|
|
73
81
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
+
import { Swipeable } from 'react-swipeable';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import Button from '@material-ui/core/Button';
|
|
5
6
|
import DialogContent from '@material-ui/core/DialogContent';
|
|
@@ -16,7 +17,6 @@ import OptionlistitemAmount from '../OptionAmount';
|
|
|
16
17
|
import getImageUrl from '../../../../Utils/getImageUrl';
|
|
17
18
|
import Markdown from '../../../../../Framework/Components/Markdown';
|
|
18
19
|
import ZoomImage from './ZoomImage';
|
|
19
|
-
import { LEFT, RIGHT, Swipeable } from '../../../../../Shared/Components/Swipeable';
|
|
20
20
|
|
|
21
21
|
const styles = theme => ({
|
|
22
22
|
detailNav: {
|
|
@@ -189,11 +189,14 @@ class Optiondetail extends React.Component {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
swiped = (e) => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
swiped = (e, deltaX, deltaY) => {
|
|
193
|
+
// use only horizontal swiping
|
|
194
|
+
if (Math.abs(deltaX) >= Math.abs(deltaY)) {
|
|
195
|
+
if (deltaX > 0) {
|
|
196
|
+
this.next();
|
|
197
|
+
} else {
|
|
198
|
+
this.prev();
|
|
199
|
+
}
|
|
197
200
|
}
|
|
198
201
|
};
|
|
199
202
|
|
|
@@ -348,14 +351,15 @@ class Optiondetail extends React.Component {
|
|
|
348
351
|
</div>
|
|
349
352
|
) : (
|
|
350
353
|
<Swipeable
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}}
|
|
356
|
-
ref={this.setDetailsContainerRef}
|
|
357
|
-
className={showNav ? classes.detailContainerWithNav : classes.detailContainer}
|
|
354
|
+
disabled={!showNav}
|
|
355
|
+
trackMouse={true}
|
|
356
|
+
onSwiped={this.swiped}
|
|
357
|
+
delta={Optiondetail.swipeDelta}
|
|
358
358
|
>
|
|
359
|
+
<div
|
|
360
|
+
ref={this.setDetailsContainerRef}
|
|
361
|
+
className={showNav ? classes.detailContainerWithNav : classes.detailContainer}
|
|
362
|
+
>
|
|
359
363
|
{showNav && (
|
|
360
364
|
<div className={clsx(classes.detailNav, 'prev')} onClick={this.prev} />
|
|
361
365
|
)}
|
|
@@ -395,6 +399,7 @@ class Optiondetail extends React.Component {
|
|
|
395
399
|
{showNav && (
|
|
396
400
|
<div className={clsx(classes.detailNav, 'next')} onClick={this.next} />
|
|
397
401
|
)}
|
|
402
|
+
</div>
|
|
398
403
|
</Swipeable>
|
|
399
404
|
)}
|
|
400
405
|
</DialogContent>
|
|
@@ -599,6 +599,6 @@ export default function configuratorReducer(prevState = initialState, action = {
|
|
|
599
599
|
function filterOptionsWithDetails(options) {
|
|
600
600
|
return _.filter(
|
|
601
601
|
options,
|
|
602
|
-
option => !!(option.abstract || option.description || option.
|
|
602
|
+
option => !!(option.abstract || option.description || option.detailImageExists === true)
|
|
603
603
|
);
|
|
604
604
|
}
|
|
@@ -402,7 +402,7 @@ class AmountPrice extends React.Component {
|
|
|
402
402
|
const { showReceiveOfferForm, clientTexts } = this.props;
|
|
403
403
|
const { dataPrivacyLink } = clientTexts;
|
|
404
404
|
const dataPrivacyApproved = this.state.dataPrivacyAccepted.value;
|
|
405
|
-
return showReceiveOfferForm
|
|
405
|
+
return !dataPrivacyLink || !showReceiveOfferForm || dataPrivacyApproved;
|
|
406
406
|
};
|
|
407
407
|
|
|
408
408
|
handleTouchMove = (evt => {
|
package/src/App/configuration.js
CHANGED
|
@@ -9,7 +9,7 @@ import { setStateChangeReducers, setSubReducers } from './Reducers/Configurator/
|
|
|
9
9
|
const DEVELOPMENT_HOST_INT = 'http://int.configuratorware.local';
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line no-unused-vars
|
|
12
|
-
const DEVELOPMENT_HOST_LOCAL =
|
|
12
|
+
const DEVELOPMENT_HOST_LOCAL = 'http://localhost:10030';
|
|
13
13
|
|
|
14
14
|
const hostsByNodeEnv = {
|
|
15
15
|
production: '',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Swipeable } from 'react-swipeable';
|
|
2
3
|
import _ from 'lodash';
|
|
3
4
|
|
|
4
5
|
import './Styles.scss';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import clsx from 'clsx';
|
|
7
8
|
import { withStyles } from '@material-ui/core/styles';
|
|
8
|
-
import { DOWN, LEFT, RIGHT, Swipeable, UP } from '../../../Shared/Components/Swipeable';
|
|
9
9
|
|
|
10
10
|
const styles = theme => ({
|
|
11
11
|
carousel: {
|
|
@@ -37,12 +37,10 @@ class Carousel extends React.Component {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
componentDidMount() {
|
|
40
|
+
this.init();
|
|
40
41
|
const { carousel } = this.refs;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const wheelEventName = 'onwheel' in carousel ? 'wheel' : 'mousewheel';
|
|
44
|
-
carousel.addEventListener(wheelEventName, this.scrolled);
|
|
45
|
-
}
|
|
42
|
+
const wheelEventName = 'onwheel' in carousel ? 'wheel' : 'mousewheel';
|
|
43
|
+
carousel.addEventListener(wheelEventName, this.scrolled);
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
componentDidUpdate() {
|
|
@@ -142,16 +140,19 @@ class Carousel extends React.Component {
|
|
|
142
140
|
};
|
|
143
141
|
|
|
144
142
|
swiped = e => {
|
|
145
|
-
if
|
|
146
|
-
|
|
143
|
+
// if it's vertical deltaY should be the bigger
|
|
144
|
+
if (this.props.vertical && Math.abs(e.deltaY) >= Math.abs(e.deltaX)) {
|
|
145
|
+
if (e.deltaY > 0) {
|
|
147
146
|
this.next();
|
|
148
|
-
} else
|
|
147
|
+
} else {
|
|
149
148
|
this.prev();
|
|
150
149
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
150
|
+
}
|
|
151
|
+
// if it's not vertical deltaX should be the bigger
|
|
152
|
+
else if (!this.props.vertical && Math.abs(e.deltaX) >= Math.abs(e.deltaY)) {
|
|
153
|
+
if (e.deltaX > 0) {
|
|
153
154
|
this.next();
|
|
154
|
-
} else
|
|
155
|
+
} else {
|
|
155
156
|
this.prev();
|
|
156
157
|
}
|
|
157
158
|
}
|
|
@@ -198,11 +199,9 @@ class Carousel extends React.Component {
|
|
|
198
199
|
)}
|
|
199
200
|
<Swipeable
|
|
200
201
|
className={'carousel-frame'}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
onSwiped: this.swiped,
|
|
205
|
-
}}
|
|
202
|
+
trackMouse={true}
|
|
203
|
+
onSwiping={this.swiping}
|
|
204
|
+
onSwiped={this.swiped}
|
|
206
205
|
>
|
|
207
206
|
<div
|
|
208
207
|
className="carousel-slider"
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "UP", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _reactSwipeable.UP;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "DOWN", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _reactSwipeable.DOWN;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "LEFT", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _reactSwipeable.LEFT;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "RIGHT", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _reactSwipeable.RIGHT;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
exports.Swipeable = void 0;
|
|
31
|
-
|
|
32
|
-
var _react = _interopRequireDefault(require("react"));
|
|
33
|
-
|
|
34
|
-
var _reactSwipeable = require("react-swipeable");
|
|
35
|
-
|
|
36
|
-
var _excluded = ["options"];
|
|
37
|
-
|
|
38
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
39
|
-
|
|
40
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
41
|
-
|
|
42
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
43
|
-
|
|
44
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
45
|
-
|
|
46
|
-
var Swipeable = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
47
|
-
var options = _ref.options,
|
|
48
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
-
|
|
50
|
-
var handlers = (0, _reactSwipeable.useSwipeable)(options);
|
|
51
|
-
return /*#__PURE__*/_react["default"].createElement("div", _extends({}, handlers, props, {
|
|
52
|
-
ref: ref
|
|
53
|
-
}));
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
exports.Swipeable = Swipeable;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSwipeable, UP, DOWN, LEFT, RIGHT } from 'react-swipeable';
|
|
3
|
-
|
|
4
|
-
export { UP, DOWN, LEFT, RIGHT };
|
|
5
|
-
|
|
6
|
-
export const Swipeable = React.forwardRef(({ options, ...props }, ref) => {
|
|
7
|
-
const handlers = useSwipeable(options);
|
|
8
|
-
return <div {...handlers} {...props} ref={ref} />;
|
|
9
|
-
});
|