shop: cleanup request, update npm deps

This commit is contained in:
Sebastien Bourdeauducq 2020-04-15 21:17:48 +08:00
parent 103056cbe8
commit 88e4f1d8c0
4 changed files with 1051 additions and 849 deletions

1461
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,10 +12,10 @@
"url": "https://git.m-labs.hk/M-Labs/web2019.git" "url": "https://git.m-labs.hk/M-Labs/web2019.git"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.6.4", "@babel/cli": "^7.8.4",
"@babel/core": "^7.6.4", "@babel/core": "^7.9.0",
"@babel/preset-env": "^7.6.3", "@babel/preset-env": "^7.9.5",
"@babel/preset-react": "^7.6.3", "@babel/preset-react": "^7.9.4",
"babel-preset-minify": "^0.5.1" "babel-preset-minify": "^0.5.1"
}, },
"babel": { "babel": {

View File

@ -1846,20 +1846,11 @@ class Shop extends React.PureComponent {
const {data} = this.props; const {data} = this.props;
const a = document.createElement('a');
const num = (new Date()).getTime();
const subject = `[Order hardware] - Request Quote`;
let body = `Hello!<br><br>I would like to request a quotation for my below configuration:<br><br>${JSON.stringify(crate)}<br><br>(Please do not edit the machine-readable representation above)<br><br>`;
if (note) {
body = `${body}<br><br>Additional note:<br><br>${note ? note.trim() : ''}`;
}
this.setState({isProcessing: true}); this.setState({isProcessing: true});
axios.post(data.API_RFQ, { axios.post(data.API_RFQ, {
email, email,
body, note,
configuration: JSON.stringify(crate), configuration: JSON.stringify(crate),
headers: {'X-MLABS-OH': 'rlebcleu'} headers: {'X-MLABS-OH': 'rlebcleu'}
}).then(response => { }).then(response => {
@ -1874,14 +1865,6 @@ class Shop extends React.PureComponent {
alert("We cannot receive your request. Try using the export by coping the configuration and send it to us at sales[at]m-labs.hk"); alert("We cannot receive your request. Try using the export by coping the configuration and send it to us at sales[at]m-labs.hk");
}); });
}) })
return;
document.body.appendChild(a);
a.style = 'display: none';
a.href = `mailto:sales@m-labs.hk?subject=${subject}&body=${encodeURIComponent(body)}`;
a.click();
} }
handleOnDragEnd(result, newAdded) { handleOnDragEnd(result, newAdded) {

410
static/js/shop.min.js vendored
View File

@ -2,16 +2,10 @@
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); } 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); }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
@ -20,17 +14,31 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
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; } 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; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@ -156,11 +164,11 @@ function formatMoney(amount) {
* Component that provides a base layout (aside/main) for the page. * Component that provides a base layout (aside/main) for the page.
*/ */
var Layout = var Layout = /*#__PURE__*/function (_React$PureComponent) {
/*#__PURE__*/
function (_React$PureComponent) {
_inherits(Layout, _React$PureComponent); _inherits(Layout, _React$PureComponent);
var _super = _createSuper(Layout);
_createClass(Layout, null, [{ _createClass(Layout, null, [{
key: "propTypes", key: "propTypes",
get: function get() { get: function get() {
@ -191,7 +199,7 @@ function (_React$PureComponent) {
_classCallCheck(this, Layout); _classCallCheck(this, Layout);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Layout).call(this, props)); _this = _super.call(this, props);
_this.state = { _this.state = {
customconf: '', customconf: '',
error: null error: null
@ -306,18 +314,18 @@ function (_React$PureComponent) {
showRFQFeedback = _this$props.showRFQFeedback, showRFQFeedback = _this$props.showRFQFeedback,
RFQBodyType = _this$props.RFQBodyType, RFQBodyType = _this$props.RFQBodyType,
RFQBodyOrder = _this$props.RFQBodyOrder; RFQBodyOrder = _this$props.RFQBodyOrder;
return React.createElement("div", { return /*#__PURE__*/React.createElement("div", {
className: "layout" className: "layout"
}, React.createElement("aside", { }, /*#__PURE__*/React.createElement("aside", {
className: 'aside ' + (mobileSideMenuShouldOpen ? 'menu-opened' : '') className: 'aside ' + (mobileSideMenuShouldOpen ? 'menu-opened' : '')
}, aside), mobileSideMenuShouldOpen ? React.createElement("section", { }, aside), mobileSideMenuShouldOpen ? /*#__PURE__*/React.createElement("section", {
className: "main", className: "main",
onClick: onClickToggleMobileSideMenu onClick: onClickToggleMobileSideMenu
}, main) : React.createElement("section", { }, main) : /*#__PURE__*/React.createElement("section", {
className: "main" className: "main"
}, main), isMobile && newCardJustAdded ? React.createElement("div", { }, main), isMobile && newCardJustAdded ? /*#__PURE__*/React.createElement("div", {
className: "feedback-add-success" className: "feedback-add-success"
}, "\u2713 added") : null, React.createElement("div", { }, "\u2713 added") : null, /*#__PURE__*/React.createElement("div", {
"class": "modal fade ".concat(showRFQFeedback ? 'show' : ''), "class": "modal fade ".concat(showRFQFeedback ? 'show' : ''),
style: { style: {
'display': showRFQFeedback ? 'block' : 'none' 'display': showRFQFeedback ? 'block' : 'none'
@ -327,34 +335,34 @@ function (_React$PureComponent) {
role: "dialog", role: "dialog",
"aria-labelledby": "exampleModalLabel", "aria-labelledby": "exampleModalLabel",
"aria-hidden": "true" "aria-hidden": "true"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
"class": "modal-dialog", "class": "modal-dialog",
role: "document" role: "document"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
"class": "modal-content" "class": "modal-content"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
"class": "modal-body rfqFeedback" "class": "modal-body rfqFeedback"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
className: "d-flex w-100" className: "d-flex w-100"
}, RFQBodyType === 'email' ? React.createElement("div", { }, RFQBodyType === 'email' ? /*#__PURE__*/React.createElement("div", {
className: "d-flex" className: "d-flex"
}, React.createElement("div", null, React.createElement("img", { }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", {
width: "30px", width: "30px",
src: "/images/shop/icon-done.svg", src: "/images/shop/icon-done.svg",
alt: "close" alt: "close"
})), React.createElement("div", { })), /*#__PURE__*/React.createElement("div", {
style: { style: {
'padding': '0 .5em' 'padding': '0 .5em'
} }
}, "We've received your request and will be in contact soon.")) : null, RFQBodyType === 'show' ? React.createElement("p", null, RFQBodyOrder) : null, RFQBodyType === 'import' ? React.createElement("div", { }, "We've received your request and will be in contact soon.")) : null, RFQBodyType === 'show' ? /*#__PURE__*/React.createElement("p", null, RFQBodyOrder) : null, RFQBodyType === 'import' ? /*#__PURE__*/React.createElement("div", {
className: "w-100" className: "w-100"
}, React.createElement("form", { }, /*#__PURE__*/React.createElement("form", {
className: "form w-100" className: "form w-100"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
className: "form-group" className: "form-group"
}, React.createElement("p", { }, /*#__PURE__*/React.createElement("p", {
className: "small" className: "small"
}, "Add your own configuration below. Should be something like:", React.createElement("br", null), JSON.stringify({ }, "Add your own configuration below. Should be something like:", /*#__PURE__*/React.createElement("br", null), JSON.stringify({
"items": [{ "items": [{
"pn": "1123" "pn": "1123"
}, { }, {
@ -365,34 +373,34 @@ function (_React$PureComponent) {
"pn": "2128" "pn": "2128"
}], }],
"type": "desktop" "type": "desktop"
}))), React.createElement("div", { }))), /*#__PURE__*/React.createElement("div", {
className: "form-group w-100" className: "form-group w-100"
}, React.createElement("textarea", { }, /*#__PURE__*/React.createElement("textarea", {
onChange: this.handleCustomConfig, onChange: this.handleCustomConfig,
value: this.state.customconf, value: this.state.customconf,
className: "form-control w-100", className: "form-control w-100",
rows: "5", rows: "5",
placeholder: "Add your custom configuration here. e.g " placeholder: "Add your custom configuration here. e.g "
})), this.state.error ? React.createElement("div", { })), this.state.error ? /*#__PURE__*/React.createElement("div", {
className: "form-group" className: "form-group"
}, React.createElement("p", { }, /*#__PURE__*/React.createElement("p", {
className: "text-danger" className: "text-danger"
}, this.state.error)) : null), React.createElement("div", { }, this.state.error)) : null), /*#__PURE__*/React.createElement("div", {
className: "d-flex flex-column flex-sm-row justify-content-end" className: "d-flex flex-column flex-sm-row justify-content-end"
}, React.createElement("a", { }, /*#__PURE__*/React.createElement("a", {
type: "button", type: "button",
onClick: onClickCloseRFQFeedback, onClick: onClickCloseRFQFeedback,
"class": "btn btn-sm btn-outline-primary m-0 mb-2 mb-sm-0 mr-sm-2" "class": "btn btn-sm btn-outline-primary m-0 mb-2 mb-sm-0 mr-sm-2"
}, "Close"), React.createElement("a", { }, "Close"), /*#__PURE__*/React.createElement("a", {
type: "button", type: "button",
onClick: this.handleClickLoad, onClick: this.handleClickLoad,
"class": "btn btn-sm btn-primary m-0 ml-sm-2 ".concat(this.state.error ? 'disabled' : '') "class": "btn btn-sm btn-primary m-0 ml-sm-2 ".concat(this.state.error ? 'disabled' : '')
}, "Load configuration"))) : null, React.createElement("div", null, React.createElement("button", { }, "Load configuration"))) : null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
onClick: onClickCloseRFQFeedback onClick: onClickCloseRFQFeedback
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-close.svg", src: "/images/shop/icon-close.svg",
alt: "close" alt: "close"
})))))))), React.createElement("div", { })))))))), /*#__PURE__*/React.createElement("div", {
onClick: onClickCloseRFQFeedback, onClick: onClickCloseRFQFeedback,
className: "modal-backdrop fade ".concat(showRFQFeedback ? 'show' : ''), className: "modal-backdrop fade ".concat(showRFQFeedback ? 'show' : ''),
style: { style: {
@ -410,11 +418,11 @@ function (_React$PureComponent) {
*/ */
var ProductItem = var ProductItem = /*#__PURE__*/function (_React$PureComponent2) {
/*#__PURE__*/
function (_React$PureComponent2) {
_inherits(ProductItem, _React$PureComponent2); _inherits(ProductItem, _React$PureComponent2);
var _super2 = _createSuper(ProductItem);
_createClass(ProductItem, null, [{ _createClass(ProductItem, null, [{
key: "propTypes", key: "propTypes",
get: function get() { get: function get() {
@ -437,7 +445,7 @@ function (_React$PureComponent2) {
_classCallCheck(this, ProductItem); _classCallCheck(this, ProductItem);
_this2 = _possibleConstructorReturn(this, _getPrototypeOf(ProductItem).call(this, props)); _this2 = _super2.call(this, props);
_this2.handleOnClickAddItem = _this2.handleOnClickAddItem.bind(_assertThisInitialized(_this2)); _this2.handleOnClickAddItem = _this2.handleOnClickAddItem.bind(_assertThisInitialized(_this2));
return _this2; return _this2;
} }
@ -463,39 +471,39 @@ function (_React$PureComponent2) {
currency = _this$props2.currency, currency = _this$props2.currency,
image = _this$props2.image, image = _this$props2.image,
specs = _this$props2.specs; specs = _this$props2.specs;
var render_specs = specs && specs.length > 0 && React.createElement("ul", null, specs.map(function (spec, index) { var render_specs = specs && specs.length > 0 && /*#__PURE__*/React.createElement("ul", null, specs.map(function (spec, index) {
return React.createElement("li", { return /*#__PURE__*/React.createElement("li", {
key: index key: index
}, spec); }, spec);
})); }));
return React.createElement("section", { return /*#__PURE__*/React.createElement("section", {
className: "productItem" className: "productItem"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
className: "content" className: "content"
}, React.createElement("h3", { }, /*#__PURE__*/React.createElement("h3", {
style: { style: {
'margin-bottom': name_codename ? '5px' : '20px' 'margin-bottom': name_codename ? '5px' : '20px'
} }
}, name), name_codename ? React.createElement("p", null, name_codename) : null, React.createElement("div", { }, name), name_codename ? /*#__PURE__*/React.createElement("p", null, name_codename) : null, /*#__PURE__*/React.createElement("div", {
className: "price" className: "price"
}, "".concat(currency, " ").concat(formatMoney(price))), render_specs), React.createElement("div", { }, "".concat(currency, " ").concat(formatMoney(price))), render_specs), /*#__PURE__*/React.createElement("div", {
className: "content" className: "content"
}, React.createElement("button", { }, /*#__PURE__*/React.createElement("button", {
onClick: this.handleOnClickAddItem.bind(this, index, true) onClick: this.handleOnClickAddItem.bind(this, index, true)
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-add.svg", src: "/images/shop/icon-add.svg",
alt: "add" alt: "add"
})), React.createElement(Draggable, { })), /*#__PURE__*/React.createElement(Draggable, {
draggableId: id, draggableId: id,
index: index index: index
}, function (provided, snapshot) { }, function (provided, snapshot) {
return React.createElement(React.Fragment, null, React.createElement("img", _extends({ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", _extends({
ref: provided.innerRef ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, { }, provided.draggableProps, provided.dragHandleProps, {
style: productStyle(provided.draggableProps.style, snapshot, true // hack: remove weird animation after a drop style: productStyle(provided.draggableProps.style, snapshot, true // hack: remove weird animation after a drop
), ),
src: image src: image
})), snapshot.isDragging && React.createElement("img", { })), snapshot.isDragging && /*#__PURE__*/React.createElement("img", {
className: "simclone", className: "simclone",
src: image src: image
})); }));
@ -511,11 +519,11 @@ function (_React$PureComponent2) {
*/ */
var ProductCartItem = var ProductCartItem = /*#__PURE__*/function (_React$PureComponent3) {
/*#__PURE__*/
function (_React$PureComponent3) {
_inherits(ProductCartItem, _React$PureComponent3); _inherits(ProductCartItem, _React$PureComponent3);
var _super3 = _createSuper(ProductCartItem);
_createClass(ProductCartItem, null, [{ _createClass(ProductCartItem, null, [{
key: "propTypes", key: "propTypes",
get: function get() { get: function get() {
@ -545,7 +553,7 @@ function (_React$PureComponent3) {
_classCallCheck(this, ProductCartItem); _classCallCheck(this, ProductCartItem);
_this3 = _possibleConstructorReturn(this, _getPrototypeOf(ProductCartItem).call(this, props)); _this3 = _super3.call(this, props);
_this3.handleOnMouseEnterItem = _this3.handleOnMouseEnterItem.bind(_assertThisInitialized(_this3)); _this3.handleOnMouseEnterItem = _this3.handleOnMouseEnterItem.bind(_assertThisInitialized(_this3));
_this3.handleOnMouseLeaveItem = _this3.handleOnMouseLeaveItem.bind(_assertThisInitialized(_this3)); _this3.handleOnMouseLeaveItem = _this3.handleOnMouseLeaveItem.bind(_assertThisInitialized(_this3));
_this3.handleOnMouseEnterWarningItem = _this3.handleOnMouseEnterWarningItem.bind(_assertThisInitialized(_this3)); _this3.handleOnMouseEnterWarningItem = _this3.handleOnMouseEnterWarningItem.bind(_assertThisInitialized(_this3));
@ -652,22 +660,22 @@ function (_React$PureComponent3) {
switch (model.type) { switch (model.type) {
case 'kasli': case 'kasli':
case 'kasli-backplane': case 'kasli-backplane':
render_progress = React.createElement("div", { render_progress = /*#__PURE__*/React.createElement("div", {
className: "k-popup-connectors" className: "k-popup-connectors"
}, React.createElement("p", null, "".concat(data.nbrCurrentSlot, "/").concat(model.nbrSlotMax, " EEM connectors used")), React.createElement("p", null, "".concat(data.nbrCurrentClock, "/").concat(model.nbrClockMax, " Clock connectors used"))); }, /*#__PURE__*/React.createElement("p", null, "".concat(data.nbrCurrentSlot, "/").concat(model.nbrSlotMax, " EEM connectors used")), /*#__PURE__*/React.createElement("p", null, "".concat(data.nbrCurrentClock, "/").concat(model.nbrClockMax, " Clock connectors used")));
break; break;
case 'zotino': case 'zotino':
case 'hd68': case 'hd68':
render_progress = React.createElement("div", { render_progress = /*#__PURE__*/React.createElement("div", {
className: "k-popup-connectors" className: "k-popup-connectors"
}, React.createElement("p", null, "".concat(data.nbrCurrentSlot, "/").concat(model.nbrSlotMax, " connectors used"))); }, /*#__PURE__*/React.createElement("p", null, "".concat(data.nbrCurrentSlot, "/").concat(model.nbrSlotMax, " connectors used")));
break; break;
case 'clocker': case 'clocker':
render_progress = React.createElement("div", { render_progress = /*#__PURE__*/React.createElement("div", {
className: "k-popup-connectors" className: "k-popup-connectors"
}, React.createElement("p", null, "".concat(data.nbrCurrentClock, "/").concat(model.nbrClockMax, " Clock connectors used"))); }, /*#__PURE__*/React.createElement("p", null, "".concat(data.nbrCurrentClock, "/").concat(model.nbrClockMax, " Clock connectors used")));
break; break;
default: default:
@ -675,61 +683,61 @@ function (_React$PureComponent3) {
} }
} }
return React.createElement(Draggable, { return /*#__PURE__*/React.createElement(Draggable, {
draggableId: model.id, draggableId: model.id,
index: index index: index
}, function (provided, snapshot) { }, function (provided, snapshot) {
return React.createElement("div", _extends({ return /*#__PURE__*/React.createElement("div", _extends({
ref: provided.innerRef ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, { }, provided.draggableProps, provided.dragHandleProps, {
style: _objectSpread({}, productStyle(provided.draggableProps.style, snapshot, true, hovered ? true : false, model.selected ? true : false)), style: _objectSpread({}, productStyle(provided.draggableProps.style, snapshot, true, hovered ? true : false, model.selected ? true : false)),
onMouseEnter: _this4.handleOnMouseEnterRemoveItem.bind(_this4, index), onMouseEnter: _this4.handleOnMouseEnterRemoveItem.bind(_this4, index),
onMouseLeave: _this4.handleOnMouseLeaveRemoveItem.bind(_this4, index) onMouseLeave: _this4.handleOnMouseLeaveRemoveItem.bind(_this4, index)
}), React.createElement("div", { }), /*#__PURE__*/React.createElement("div", {
style: { style: {
'height': '24px' 'height': '24px'
}, },
className: "progress-container warning", className: "progress-container warning",
onMouseEnter: _this4.handleOnMouseEnterWarningItem.bind(_this4, index, warning), onMouseEnter: _this4.handleOnMouseEnterWarningItem.bind(_this4, index, warning),
onMouseLeave: _this4.handleOnMouseLeaveWarningItem.bind(_this4, index, warning) onMouseLeave: _this4.handleOnMouseLeaveWarningItem.bind(_this4, index, warning)
}, warning && React.createElement("img", { }, warning && /*#__PURE__*/React.createElement("img", {
className: "alert-warning", className: "alert-warning",
src: warning ? "/images".concat(warning.icon) : null src: warning ? "/images".concat(warning.icon) : null
}), warning && model.showWarning && React.createElement("div", { }), warning && model.showWarning && /*#__PURE__*/React.createElement("div", {
className: "k-popup-warning" className: "k-popup-warning"
}, React.createElement("p", { }, /*#__PURE__*/React.createElement("p", {
className: "rule warning" className: "rule warning"
}, React.createElement("i", null, warning.message)))), React.createElement("h6", null, model.name_number), React.createElement("div", { }, /*#__PURE__*/React.createElement("i", null, warning.message)))), /*#__PURE__*/React.createElement("h6", null, model.name_number), /*#__PURE__*/React.createElement("div", {
style: { style: {
'height': '350px' 'height': '350px'
}, },
onMouseEnter: _this4.handleOnMouseEnterRemoveItem.bind(_this4, index) onMouseEnter: _this4.handleOnMouseEnterRemoveItem.bind(_this4, index)
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
className: "item-cart", className: "item-cart",
src: "/images".concat(model.image) src: "/images".concat(model.image)
})), React.createElement("div", { })), /*#__PURE__*/React.createElement("div", {
style: { style: {
'display': model.showOverlayRemove ? 'flex' : 'none' 'display': model.showOverlayRemove ? 'flex' : 'none'
}, },
className: "overlayRemove", className: "overlayRemove",
onClick: _this4.handleOnClickRemoveItem.bind(_this4, index) onClick: _this4.handleOnClickRemoveItem.bind(_this4, index)
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-remove.svg", src: "/images/shop/icon-remove.svg",
alt: "rm" alt: "rm"
}), React.createElement("p", null, "Remove")), React.createElement("div", { }), /*#__PURE__*/React.createElement("p", null, "Remove")), /*#__PURE__*/React.createElement("div", {
style: { style: {
'height': '22px' 'height': '22px'
}, },
className: "progress-container", className: "progress-container",
onMouseEnter: _this4.handleOnMouseEnterItem.bind(_this4, index), onMouseEnter: _this4.handleOnMouseEnterItem.bind(_this4, index),
onMouseLeave: _this4.handleOnMouseLeaveItem.bind(_this4, index) onMouseLeave: _this4.handleOnMouseLeaveItem.bind(_this4, index)
}, model.nbrSlotMax > 0 && React.createElement("div", { }, model.nbrSlotMax > 0 && /*#__PURE__*/React.createElement("div", {
className: "nbr-connectors" className: "nbr-connectors"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
style: _objectSpread({}, nbrConnectorsStyle(data)) style: _objectSpread({}, nbrConnectorsStyle(data))
})), model.nbrClockMax > 0 && React.createElement("div", { })), model.nbrClockMax > 0 && /*#__PURE__*/React.createElement("div", {
className: "nbr-clocks" className: "nbr-clocks"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
style: _objectSpread({}, nbrClocksStyle(data)) style: _objectSpread({}, nbrClocksStyle(data))
})), render_progress)); })), render_progress));
}); });
@ -744,15 +752,15 @@ function (_React$PureComponent3) {
*/ */
var FakePlaceholder = var FakePlaceholder = /*#__PURE__*/function (_React$PureComponent4) {
/*#__PURE__*/
function (_React$PureComponent4) {
_inherits(FakePlaceholder, _React$PureComponent4); _inherits(FakePlaceholder, _React$PureComponent4);
var _super4 = _createSuper(FakePlaceholder);
function FakePlaceholder() { function FakePlaceholder() {
_classCallCheck(this, FakePlaceholder); _classCallCheck(this, FakePlaceholder);
return _possibleConstructorReturn(this, _getPrototypeOf(FakePlaceholder).apply(this, arguments)); return _super4.apply(this, arguments);
} }
_createClass(FakePlaceholder, [{ _createClass(FakePlaceholder, [{
@ -766,7 +774,7 @@ function (_React$PureComponent4) {
var nbrOccupied = nbrOccupiedSlotsInCrate(items); var nbrOccupied = nbrOccupiedSlotsInCrate(items);
for (var i = nbrSlots - nbrOccupied; i > 0; i--) { for (var i = nbrSlots - nbrOccupied; i > 0; i--) {
fakePlaceholder.push(React.createElement("div", { fakePlaceholder.push( /*#__PURE__*/React.createElement("div", {
key: i, key: i,
style: { style: {
display: isDraggingOver ? 'none' : 'block', display: isDraggingOver ? 'none' : 'block',
@ -777,7 +785,7 @@ function (_React$PureComponent4) {
})); }));
} }
return React.createElement(React.Fragment, null, fakePlaceholder); return /*#__PURE__*/React.createElement(React.Fragment, null, fakePlaceholder);
} }
}], [{ }], [{
key: "propTypes", key: "propTypes",
@ -797,15 +805,15 @@ function (_React$PureComponent4) {
*/ */
var Cart = var Cart = /*#__PURE__*/function (_React$PureComponent5) {
/*#__PURE__*/
function (_React$PureComponent5) {
_inherits(Cart, _React$PureComponent5); _inherits(Cart, _React$PureComponent5);
var _super5 = _createSuper(Cart);
function Cart() { function Cart() {
_classCallCheck(this, Cart); _classCallCheck(this, Cart);
return _possibleConstructorReturn(this, _getPrototypeOf(Cart).apply(this, arguments)); return _super5.apply(this, arguments);
} }
_createClass(Cart, [{ _createClass(Cart, [{
@ -827,7 +835,7 @@ function (_React$PureComponent5) {
itemData = data.itemsData[index]; itemData = data.itemsData[index];
} }
return React.createElement(ProductCartItem, { return /*#__PURE__*/React.createElement(ProductCartItem, {
isMobile: isMobile, isMobile: isMobile,
hovered: item.id === itemHovered, hovered: item.id === itemHovered,
key: item.id, key: item.id,
@ -840,20 +848,20 @@ function (_React$PureComponent5) {
model: item model: item
}); });
}); });
return React.createElement(Droppable, { return /*#__PURE__*/React.createElement(Droppable, {
droppableId: data.id, droppableId: data.id,
direction: "horizontal" direction: "horizontal"
}, function (provided, snapshot) { }, function (provided, snapshot) {
return React.createElement("div", _extends({ return /*#__PURE__*/React.createElement("div", _extends({
ref: provided.innerRef ref: provided.innerRef
}, provided.droppableProps, { }, provided.droppableProps, {
style: cartStyle(provided.droppableProps.style, snapshot), style: cartStyle(provided.droppableProps.style, snapshot),
className: "items-cart-list" className: "items-cart-list"
}), products, provided.placeholder && React.createElement("div", { }), products, provided.placeholder && /*#__PURE__*/React.createElement("div", {
style: { style: {
display: 'none' display: 'none'
} }
}, provided.placeholder), React.createElement(FakePlaceholder, { }, provided.placeholder), /*#__PURE__*/React.createElement(FakePlaceholder, {
nbrSlots: nbrSlots, nbrSlots: nbrSlots,
items: data.items, items: data.items,
isDraggingOver: snapshot.isDraggingOver isDraggingOver: snapshot.isDraggingOver
@ -883,11 +891,11 @@ function (_React$PureComponent5) {
*/ */
var CrateMode = var CrateMode = /*#__PURE__*/function (_React$PureComponent6) {
/*#__PURE__*/
function (_React$PureComponent6) {
_inherits(CrateMode, _React$PureComponent6); _inherits(CrateMode, _React$PureComponent6);
var _super6 = _createSuper(CrateMode);
_createClass(CrateMode, null, [{ _createClass(CrateMode, null, [{
key: "propTypes", key: "propTypes",
get: function get() { get: function get() {
@ -904,7 +912,7 @@ function (_React$PureComponent6) {
_classCallCheck(this, CrateMode); _classCallCheck(this, CrateMode);
_this5 = _possibleConstructorReturn(this, _getPrototypeOf(CrateMode).call(this, props)); _this5 = _super6.call(this, props);
_this5.handleOnClickMode = _this5.handleOnClickMode.bind(_assertThisInitialized(_this5)); _this5.handleOnClickMode = _this5.handleOnClickMode.bind(_assertThisInitialized(_this5));
return _this5; return _this5;
} }
@ -926,10 +934,10 @@ function (_React$PureComponent6) {
var _this$props6 = this.props, var _this$props6 = this.props,
mode = _this$props6.mode, mode = _this$props6.mode,
items = _this$props6.items; items = _this$props6.items;
return React.createElement("div", { return /*#__PURE__*/React.createElement("div", {
className: "crate-mode" className: "crate-mode"
}, items.map(function (item) { }, items.map(function (item) {
return React.createElement("a", { return /*#__PURE__*/React.createElement("a", {
key: item.id, key: item.id,
className: mode == item.id ? 'active' : '', className: mode == item.id ? 'active' : '',
onClick: _this6.handleOnClickMode.bind(_this6, item.id), onClick: _this6.handleOnClickMode.bind(_this6, item.id),
@ -948,15 +956,15 @@ function (_React$PureComponent6) {
*/ */
var Crate = var Crate = /*#__PURE__*/function (_React$PureComponent7) {
/*#__PURE__*/
function (_React$PureComponent7) {
_inherits(Crate, _React$PureComponent7); _inherits(Crate, _React$PureComponent7);
var _super7 = _createSuper(Crate);
function Crate() { function Crate() {
_classCallCheck(this, Crate); _classCallCheck(this, Crate);
return _possibleConstructorReturn(this, _getPrototypeOf(Crate).apply(this, arguments)); return _super7.apply(this, arguments);
} }
_createClass(Crate, [{ _createClass(Crate, [{
@ -965,22 +973,22 @@ function (_React$PureComponent7) {
var _this$props7 = this.props, var _this$props7 = this.props,
rules = _this$props7.rules, rules = _this$props7.rules,
cart = _this$props7.cart; cart = _this$props7.cart;
return React.createElement("div", { return /*#__PURE__*/React.createElement("div", {
className: "crate" className: "crate"
}, React.createElement("div", { }, /*#__PURE__*/React.createElement("div", {
className: "crate-products" className: "crate-products"
}, cart, rules && rules.length > 0 && React.createElement("div", { }, cart, rules && rules.length > 0 && /*#__PURE__*/React.createElement("div", {
className: "crate-info" className: "crate-info"
}, rules.map(function (rule, index) { }, rules.map(function (rule, index) {
return React.createElement("p", { return /*#__PURE__*/React.createElement("p", {
key: index, key: index,
className: "rule", className: "rule",
style: { style: {
'color': rule.color ? rule.color : 'inherit' 'color': rule.color ? rule.color : 'inherit'
} }
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images".concat(rule.icon) src: "/images".concat(rule.icon)
}), " ", React.createElement("i", null, React.createElement("strong", null, rule.name, ":"), " ", rule.message)); }), " ", /*#__PURE__*/React.createElement("i", null, /*#__PURE__*/React.createElement("strong", null, rule.name, ":"), " ", rule.message));
})))); }))));
} }
}], [{ }], [{
@ -1001,15 +1009,15 @@ function (_React$PureComponent7) {
*/ */
var OrderPanel = var OrderPanel = /*#__PURE__*/function (_React$PureComponent8) {
/*#__PURE__*/
function (_React$PureComponent8) {
_inherits(OrderPanel, _React$PureComponent8); _inherits(OrderPanel, _React$PureComponent8);
var _super8 = _createSuper(OrderPanel);
function OrderPanel() { function OrderPanel() {
_classCallCheck(this, OrderPanel); _classCallCheck(this, OrderPanel);
return _possibleConstructorReturn(this, _getPrototypeOf(OrderPanel).apply(this, arguments)); return _super8.apply(this, arguments);
} }
_createClass(OrderPanel, [{ _createClass(OrderPanel, [{
@ -1025,27 +1033,27 @@ function (_React$PureComponent8) {
isMobile = _this$props8.isMobile, isMobile = _this$props8.isMobile,
onClickToggleMobileSideMenu = _this$props8.onClickToggleMobileSideMenu, onClickToggleMobileSideMenu = _this$props8.onClickToggleMobileSideMenu,
onClickOpenImport = _this$props8.onClickOpenImport; onClickOpenImport = _this$props8.onClickOpenImport;
return React.createElement("section", { return /*#__PURE__*/React.createElement("section", {
className: "panel" className: "panel"
}, React.createElement("h2", null, title), React.createElement("div", { }, /*#__PURE__*/React.createElement("h2", null, title), /*#__PURE__*/React.createElement("div", {
className: "control" className: "control"
}, React.createElement("p", { }, /*#__PURE__*/React.createElement("p", {
className: "description" className: "description"
}, description), crateMode), React.createElement("div", null, React.createElement("input", { }, description), crateMode), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
className: "btn btn-sm btn-outline-primary m-0 mb-2", className: "btn btn-sm btn-outline-primary m-0 mb-2",
style: { style: {
'cursor': 'pointer' 'cursor': 'pointer'
}, },
value: "Import configurations", value: "Import configurations",
onClick: onClickOpenImport onClick: onClickOpenImport
})), isMobile ? React.createElement("div", { })), isMobile ? /*#__PURE__*/React.createElement("div", {
className: "mobileBtnDisplaySideMenu" className: "mobileBtnDisplaySideMenu"
}, React.createElement("button", { }, /*#__PURE__*/React.createElement("button", {
onClick: onClickToggleMobileSideMenu onClick: onClickToggleMobileSideMenu
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-add.svg", src: "/images/shop/icon-add.svg",
alt: "add" alt: "add"
}))) : null, crate, React.createElement("section", { }))) : null, crate, /*#__PURE__*/React.createElement("section", {
className: "summary" className: "summary"
}, summaryPrice, form)); }, summaryPrice, form));
} }
@ -1073,11 +1081,11 @@ function (_React$PureComponent8) {
*/ */
var OrderForm = var OrderForm = /*#__PURE__*/function (_React$PureComponent9) {
/*#__PURE__*/
function (_React$PureComponent9) {
_inherits(OrderForm, _React$PureComponent9); _inherits(OrderForm, _React$PureComponent9);
var _super9 = _createSuper(OrderForm);
_createClass(OrderForm, null, [{ _createClass(OrderForm, null, [{
key: "propTypes", key: "propTypes",
get: function get() { get: function get() {
@ -1094,7 +1102,7 @@ function (_React$PureComponent9) {
_classCallCheck(this, OrderForm); _classCallCheck(this, OrderForm);
_this7 = _possibleConstructorReturn(this, _getPrototypeOf(OrderForm).call(this, props)); _this7 = _super9.call(this, props);
_this7.state = { _this7.state = {
note: '', note: '',
email: '', email: '',
@ -1238,12 +1246,12 @@ function (_React$PureComponent9) {
var _this$props9 = this.props, var _this$props9 = this.props,
isProcessing = _this$props9.isProcessing, isProcessing = _this$props9.isProcessing,
isProcessingComplete = _this$props9.isProcessingComplete; isProcessingComplete = _this$props9.isProcessingComplete;
return React.createElement("div", { return /*#__PURE__*/React.createElement("div", {
className: "summary-form" className: "summary-form"
}, React.createElement("form", { }, /*#__PURE__*/React.createElement("form", {
onSubmit: handleSubmit, onSubmit: handleSubmit,
noValidate: true noValidate: true
}, React.createElement("input", { }, /*#__PURE__*/React.createElement("input", {
className: "".concat(error && error.email ? 'errorField' : ''), className: "".concat(error && error.email ? 'errorField' : ''),
type: "email", type: "email",
placeholder: "Email", placeholder: "Email",
@ -1253,18 +1261,18 @@ function (_React$PureComponent9) {
onChange: handleEmail, onChange: handleEmail,
onBlur: handleEmail, onBlur: handleEmail,
value: email value: email
}), empty && empty.email ? React.createElement("div", { }), empty && empty.email ? /*#__PURE__*/React.createElement("div", {
className: "error" className: "error"
}, React.createElement("small", null, "Required")) : null, error && error.email ? React.createElement("div", { }, /*#__PURE__*/React.createElement("small", null, "Required")) : null, error && error.email ? /*#__PURE__*/React.createElement("div", {
className: "error" className: "error"
}, React.createElement("small", null, "Your email is incomplete")) : null, React.createElement("textarea", { }, /*#__PURE__*/React.createElement("small", null, "Your email is incomplete")) : null, /*#__PURE__*/React.createElement("textarea", {
onChange: handleNote, onChange: handleNote,
value: note, value: note,
rows: "5", rows: "5",
placeholder: "Additional notes" placeholder: "Additional notes"
}), React.createElement("div", { }), /*#__PURE__*/React.createElement("div", {
className: "d-flex flex-column flex-sm-row justify-content-between" className: "d-flex flex-column flex-sm-row justify-content-between"
}, React.createElement("input", { }, /*#__PURE__*/React.createElement("input", {
className: "btn btn-outline-primary w-100 m-0 mb-2 mb-sm-0 mr-sm-2", className: "btn btn-outline-primary w-100 m-0 mb-2 mb-sm-0 mr-sm-2",
style: { style: {
'cursor': 'pointer', 'cursor': 'pointer',
@ -1272,7 +1280,7 @@ function (_React$PureComponent9) {
}, },
value: "Show configurations", value: "Show configurations",
onClick: onClickShow onClick: onClickShow
}), React.createElement("input", { }), /*#__PURE__*/React.createElement("input", {
className: "btn btn-primary w-100 m-0 ml-sm-2", className: "btn btn-primary w-100 m-0 ml-sm-2",
type: "submit", type: "submit",
value: "".concat(isProcessing ? 'Processing ...' : 'Request quote') value: "".concat(isProcessing ? 'Processing ...' : 'Request quote')
@ -1288,11 +1296,11 @@ function (_React$PureComponent9) {
*/ */
var OrderSumary = var OrderSumary = /*#__PURE__*/function (_React$PureComponent10) {
/*#__PURE__*/
function (_React$PureComponent10) {
_inherits(OrderSumary, _React$PureComponent10); _inherits(OrderSumary, _React$PureComponent10);
var _super10 = _createSuper(OrderSumary);
_createClass(OrderSumary, null, [{ _createClass(OrderSumary, null, [{
key: "propTypes", key: "propTypes",
get: function get() { get: function get() {
@ -1316,7 +1324,7 @@ function (_React$PureComponent10) {
_classCallCheck(this, OrderSumary); _classCallCheck(this, OrderSumary);
_this8 = _possibleConstructorReturn(this, _getPrototypeOf(OrderSumary).call(this, props)); _this8 = _super10.call(this, props);
_this8.handleOnDeleteItem = _this8.handleOnDeleteItem.bind(_assertThisInitialized(_this8)); _this8.handleOnDeleteItem = _this8.handleOnDeleteItem.bind(_assertThisInitialized(_this8));
_this8.handleOnDeleteAllItems = _this8.handleOnDeleteAllItems.bind(_assertThisInitialized(_this8)); _this8.handleOnDeleteAllItems = _this8.handleOnDeleteAllItems.bind(_assertThisInitialized(_this8));
_this8.handleOnMouseEnterItem = _this8.handleOnMouseEnterItem.bind(_assertThisInitialized(_this8)); _this8.handleOnMouseEnterItem = _this8.handleOnMouseEnterItem.bind(_assertThisInitialized(_this8));
@ -1386,34 +1394,34 @@ function (_React$PureComponent10) {
var mode = modes.find(function (elem) { var mode = modes.find(function (elem) {
return elem.id === currentMode; return elem.id === currentMode;
}); });
return React.createElement("div", { return /*#__PURE__*/React.createElement("div", {
className: "summary-price" className: "summary-price"
}, React.createElement("table", null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("td", { }, /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
colSpan: "2", colSpan: "2",
className: "summary-remove-all" className: "summary-remove-all"
}, React.createElement("span", { }, /*#__PURE__*/React.createElement("span", {
className: "item-card-name" className: "item-card-name"
}, "Remove all cards"), React.createElement("button", { }, "Remove all cards"), /*#__PURE__*/React.createElement("button", {
onClick: this.handleOnDeleteAllItems onClick: this.handleOnDeleteAllItems
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-remove.svg" src: "/images/shop/icon-remove.svg"
})))), mode && React.createElement("tr", null, React.createElement("td", { })))), mode && /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
className: "item-card-name" className: "item-card-name"
}, mode.name), React.createElement("td", { }, mode.name), /*#__PURE__*/React.createElement("td", {
className: "price" className: "price"
}, React.createElement("div", null, "".concat(currency, " ").concat(formatMoney(mode.price)), React.createElement("button", { }, /*#__PURE__*/React.createElement("div", null, "".concat(currency, " ").concat(formatMoney(mode.price)), /*#__PURE__*/React.createElement("button", {
style: { style: {
'opacity': '0', 'opacity': '0',
'cursor': 'initial' 'cursor': 'initial'
} }
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-remove.svg" src: "/images/shop/icon-remove.svg"
}))), React.createElement("span", { }))), /*#__PURE__*/React.createElement("span", {
style: { style: {
'display': 'inline-block', 'display': 'inline-block',
'width': '30px' 'width': '30px'
} }
}, "\xA0")))), React.createElement("tbody", null, summary.map(function (item, index) { }, "\xA0")))), /*#__PURE__*/React.createElement("tbody", null, summary.map(function (item, index) {
var alert; var alert;
var warning; var warning;
@ -1426,47 +1434,47 @@ function (_React$PureComponent10) {
} }
} }
return React.createElement("tr", { return /*#__PURE__*/React.createElement("tr", {
key: item.id, key: item.id,
className: "hoverable ".concat(item.selected ? 'selected' : ''), className: "hoverable ".concat(item.selected ? 'selected' : ''),
onClick: _this9.handleOnClickSelectItem.bind(_this9, index), onClick: _this9.handleOnClickSelectItem.bind(_this9, index),
onMouseEnter: _this9.handleOnMouseEnterItem.bind(_this9, item.id), onMouseEnter: _this9.handleOnMouseEnterItem.bind(_this9, item.id),
onMouseLeave: _this9.handleOnMouseLeaveItem onMouseLeave: _this9.handleOnMouseLeaveItem
}, React.createElement("td", { }, /*#__PURE__*/React.createElement("td", {
className: "item-card-name" className: "item-card-name"
}, React.createElement("div", null, "".concat(item.name_number, " ").concat(item.name, " ").concat(item.name_codename))), React.createElement("td", { }, /*#__PURE__*/React.createElement("div", null, "".concat(item.name_number, " ").concat(item.name, " ").concat(item.name_codename))), /*#__PURE__*/React.createElement("td", {
className: "price" className: "price"
}, React.createElement("div", null, "".concat(currency, " ").concat(formatMoney(item.price)), React.createElement("button", { }, /*#__PURE__*/React.createElement("div", null, "".concat(currency, " ").concat(formatMoney(item.price)), /*#__PURE__*/React.createElement("button", {
onClick: _this9.handleOnDeleteItem.bind(_this9, index) onClick: _this9.handleOnDeleteItem.bind(_this9, index)
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-remove.svg" src: "/images/shop/icon-remove.svg"
}))), warning && React.createElement("img", { }))), warning && /*#__PURE__*/React.createElement("img", {
style: { style: {
'marginLeft': '10px' 'marginLeft': '10px'
}, },
className: "alert-warning", className: "alert-warning",
src: "/images/".concat(warning.icon) src: "/images/".concat(warning.icon)
}), !warning && React.createElement("span", { }), !warning && /*#__PURE__*/React.createElement("span", {
style: { style: {
'display': 'inline-block', 'display': 'inline-block',
'width': '30px' 'width': '30px'
} }
}, "\xA0"))); }, "\xA0")));
})), React.createElement("tfoot", null, React.createElement("tr", null, React.createElement("td", { })), /*#__PURE__*/React.createElement("tfoot", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
className: "item-card-name" className: "item-card-name"
}, "Price estimate"), React.createElement("td", { }, "Price estimate"), /*#__PURE__*/React.createElement("td", {
className: "price" className: "price"
}, React.createElement("div", null, summary.length ? "".concat(currency, " ").concat(formatMoney(summary.reduce(function (prev, next) { }, /*#__PURE__*/React.createElement("div", null, summary.length ? "".concat(currency, " ").concat(formatMoney(summary.reduce(function (prev, next) {
return prev + next.price; return prev + next.price;
}, 0) + mode.price)) : "".concat(currency, " ").concat(formatMoney(mode.price)), React.createElement("button", { }, 0) + mode.price)) : "".concat(currency, " ").concat(formatMoney(mode.price)), /*#__PURE__*/React.createElement("button", {
style: { style: {
'opacity': '0', 'opacity': '0',
'cursor': 'initial' 'cursor': 'initial'
} }
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-remove.svg", src: "/images/shop/icon-remove.svg",
alt: "icon remove" alt: "icon remove"
}))), React.createElement("span", { }))), /*#__PURE__*/React.createElement("span", {
style: { style: {
'display': 'inline-block', 'display': 'inline-block',
'width': '30px' 'width': '30px'
@ -1482,15 +1490,15 @@ function (_React$PureComponent10) {
*/ */
var Backlog = var Backlog = /*#__PURE__*/function (_React$PureComponent11) {
/*#__PURE__*/
function (_React$PureComponent11) {
_inherits(Backlog, _React$PureComponent11); _inherits(Backlog, _React$PureComponent11);
var _super11 = _createSuper(Backlog);
function Backlog() { function Backlog() {
_classCallCheck(this, Backlog); _classCallCheck(this, Backlog);
return _possibleConstructorReturn(this, _getPrototypeOf(Backlog).apply(this, arguments)); return _super11.apply(this, arguments);
} }
_createClass(Backlog, [{ _createClass(Backlog, [{
@ -1507,7 +1515,7 @@ function (_React$PureComponent11) {
return items[itemId]; return items[itemId];
}); });
var products = ordered_items.map(function (item, index) { var products = ordered_items.map(function (item, index) {
return React.createElement(ProductItem, { return /*#__PURE__*/React.createElement(ProductItem, {
key: item.id, key: item.id,
id: item.id, id: item.id,
index: index, index: index,
@ -1520,21 +1528,21 @@ function (_React$PureComponent11) {
onClickAddItem: onClickAddItem onClickAddItem: onClickAddItem
}); });
}); });
return React.createElement(Droppable, { return /*#__PURE__*/React.createElement(Droppable, {
droppableId: data.id, droppableId: data.id,
isDropDisabled: true isDropDisabled: true
}, function (provided) { }, function (provided) {
return React.createElement("div", _extends({ return /*#__PURE__*/React.createElement("div", _extends({
className: "backlog-container", className: "backlog-container",
ref: provided.innerRef ref: provided.innerRef
}, provided.droppableProps), isMobile ? React.createElement("div", { }, provided.droppableProps), isMobile ? /*#__PURE__*/React.createElement("div", {
className: "mobileCloseMenu" className: "mobileCloseMenu"
}, React.createElement("button", { }, /*#__PURE__*/React.createElement("button", {
onClick: onClickToggleMobileSideMenu onClick: onClickToggleMobileSideMenu
}, React.createElement("img", { }, /*#__PURE__*/React.createElement("img", {
src: "/images/shop/icon-close-white.svg", src: "/images/shop/icon-close-white.svg",
alt: "add" alt: "add"
}))) : null, products, provided.placeholder && React.createElement("div", { }))) : null, products, provided.placeholder && /*#__PURE__*/React.createElement("div", {
style: { style: {
display: 'none' display: 'none'
} }
@ -1569,11 +1577,11 @@ function (_React$PureComponent11) {
*/ */
var Shop = var Shop = /*#__PURE__*/function (_React$PureComponent12) {
/*#__PURE__*/
function (_React$PureComponent12) {
_inherits(Shop, _React$PureComponent12); _inherits(Shop, _React$PureComponent12);
var _super12 = _createSuper(Shop);
_createClass(Shop, null, [{ _createClass(Shop, null, [{
key: "propTypes", key: "propTypes",
get: function get() { get: function get() {
@ -1588,7 +1596,7 @@ function (_React$PureComponent12) {
_classCallCheck(this, Shop); _classCallCheck(this, Shop);
_this10 = _possibleConstructorReturn(this, _getPrototypeOf(Shop).call(this, props)); _this10 = _super12.call(this, props);
_this10.state = _this10.props.data; _this10.state = _this10.props.data;
_this10.handleCrateModeChange = _this10.handleCrateModeChange.bind(_assertThisInitialized(_this10)); _this10.handleCrateModeChange = _this10.handleCrateModeChange.bind(_assertThisInitialized(_this10));
_this10.handleOnDragEnd = _this10.handleOnDragEnd.bind(_assertThisInitialized(_this10)); _this10.handleOnDragEnd = _this10.handleOnDragEnd.bind(_assertThisInitialized(_this10));
@ -1880,21 +1888,12 @@ function (_React$PureComponent12) {
} }
var data = this.props.data; var data = this.props.data;
var a = document.createElement('a');
var num = new Date().getTime();
var subject = "[Order hardware] - Request Quote";
var body = "Hello!<br><br>I would like to request a quotation for my below configuration:<br><br>".concat(JSON.stringify(crate), "<br><br>(Please do not edit the machine-readable representation above)<br><br>");
if (note) {
body = "".concat(body, "<br><br>Additional note:<br><br>").concat(note ? note.trim() : '');
}
this.setState({ this.setState({
isProcessing: true isProcessing: true
}); });
axios.post(data.API_RFQ, { axios.post(data.API_RFQ, {
email: email, email: email,
body: body, note: note,
configuration: JSON.stringify(crate), configuration: JSON.stringify(crate),
headers: { headers: {
'X-MLABS-OH': 'rlebcleu' 'X-MLABS-OH': 'rlebcleu'
@ -1913,11 +1912,6 @@ function (_React$PureComponent12) {
alert("We cannot receive your request. Try using the export by coping the configuration and send it to us at sales[at]m-labs.hk"); alert("We cannot receive your request. Try using the export by coping the configuration and send it to us at sales[at]m-labs.hk");
}); });
}); });
return;
document.body.appendChild(a);
a.style = 'display: none';
a.href = "mailto:sales@m-labs.hk?subject=".concat(subject, "&body=").concat(encodeURIComponent(body));
a.click();
} }
}, { }, {
key: "handleOnDragEnd", key: "handleOnDragEnd",
@ -2316,9 +2310,9 @@ function (_React$PureComponent12) {
RFQBodyOrder = _this$state3.RFQBodyOrder, RFQBodyOrder = _this$state3.RFQBodyOrder,
isProcessingComplete = _this$state3.isProcessingComplete; isProcessingComplete = _this$state3.isProcessingComplete;
var isMobile = window.deviceIsMobile(); var isMobile = window.deviceIsMobile();
return React.createElement(DragDropContext, { return /*#__PURE__*/React.createElement(DragDropContext, {
onDragEnd: this.handleOnDragEnd onDragEnd: this.handleOnDragEnd
}, React.createElement(Layout, { }, /*#__PURE__*/React.createElement(Layout, {
showRFQFeedback: shouldShowRFQFeedback, showRFQFeedback: shouldShowRFQFeedback,
RFQBodyType: RFQBodyType, RFQBodyType: RFQBodyType,
RFQBodyOrder: RFQBodyOrder, RFQBodyOrder: RFQBodyOrder,
@ -2329,7 +2323,7 @@ function (_React$PureComponent12) {
onClickToggleMobileSideMenu: this.handleClickToggleMobileSideMenu, onClickToggleMobileSideMenu: this.handleClickToggleMobileSideMenu,
onClickCloseRFQFeedback: this.handleClickCloseRFQFeedback, onClickCloseRFQFeedback: this.handleClickCloseRFQFeedback,
onClickLoadCustomConf: this.handleLoadCustomConf, onClickLoadCustomConf: this.handleLoadCustomConf,
aside: React.createElement(Backlog, { aside: /*#__PURE__*/React.createElement(Backlog, {
currency: currency, currency: currency,
items: items, items: items,
data: columns['backlog'], data: columns['backlog'],
@ -2337,19 +2331,19 @@ function (_React$PureComponent12) {
onClickToggleMobileSideMenu: this.handleClickToggleMobileSideMenu, onClickToggleMobileSideMenu: this.handleClickToggleMobileSideMenu,
isMobile: isMobile isMobile: isMobile
}), }),
main: React.createElement(OrderPanel, { main: /*#__PURE__*/React.createElement(OrderPanel, {
onClickToggleMobileSideMenu: this.handleClickToggleMobileSideMenu, onClickToggleMobileSideMenu: this.handleClickToggleMobileSideMenu,
onClickOpenImport: this.handleClickOpenImport, onClickOpenImport: this.handleClickOpenImport,
isMobile: isMobile, isMobile: isMobile,
title: "Order hardware", title: "Order hardware",
description: " Drag and drop the cards you want into the crate below to see how the combination would look like. If you have any issues with this ordering system, or if you need other configurations, email us directly anytime at sales@m-****.hk. The price is estimated and must be confirmed by a quote.", description: " Drag and drop the cards you want into the crate below to see how the combination would look like. If you have any issues with this ordering system, or if you need other configurations, email us directly anytime at sales@m-****.hk. The price is estimated and must be confirmed by a quote.",
crateMode: React.createElement(CrateMode, { crateMode: /*#__PURE__*/React.createElement(CrateMode, {
items: crateModeItems, items: crateModeItems,
mode: currentMode, mode: currentMode,
onClickMode: this.handleCrateModeChange onClickMode: this.handleCrateModeChange
}), }),
crate: React.createElement(Crate, { crate: /*#__PURE__*/React.createElement(Crate, {
cart: React.createElement(Cart, { cart: /*#__PURE__*/React.createElement(Cart, {
nbrSlots: crateModeSlots[currentMode], nbrSlots: crateModeSlots[currentMode],
data: columns['cart'], data: columns['cart'],
isMobile: isMobile, isMobile: isMobile,
@ -2363,7 +2357,7 @@ function (_React$PureComponent12) {
return rule; return rule;
}) })
}), }),
summaryPrice: React.createElement(OrderSumary, { summaryPrice: /*#__PURE__*/React.createElement(OrderSumary, {
currency: currency, currency: currency,
currentMode: currentMode, currentMode: currentMode,
modes: crateModeItems, modes: crateModeItems,
@ -2375,7 +2369,7 @@ function (_React$PureComponent12) {
onDeleteAllItems: this.handleDeleteAllItems, onDeleteAllItems: this.handleDeleteAllItems,
onClickSelectItem: this.handleClickSelectItem onClickSelectItem: this.handleClickSelectItem
}), }),
form: React.createElement(OrderForm, { form: /*#__PURE__*/React.createElement(OrderForm, {
isProcessingComplete: isProcessingComplete, isProcessingComplete: isProcessingComplete,
processingComplete: this.handleProcessingComplete, processingComplete: this.handleProcessingComplete,
isProcessing: isProcessing, isProcessing: isProcessing,
@ -2390,6 +2384,6 @@ function (_React$PureComponent12) {
return Shop; return Shop;
}(React.PureComponent); }(React.PureComponent);
ReactDOM.render(React.createElement(Shop, { ReactDOM.render( /*#__PURE__*/React.createElement(Shop, {
data: data data: data
}), document.querySelector('#root-shop')); }), document.querySelector('#root-shop'));