kitchen-simulator 5.0.0-test.18 → 5.0.0-test.19
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/package.json +8 -26
- package/src/@history.js +3 -0
- package/src/CrossSignOn.jsx +94 -0
- package/src/KitchenConfigurator.jsx +1526 -0
- package/src/KitchenConfiguratorApp.jsx +1 -1
- package/src/_KitchenConfigurator.jsx +3 -3
- package/src/components/catalog-view/catalog-breadcrumb.jsx +53 -0
- package/src/components/catalog-view/catalog-item.jsx +229 -0
- package/src/components/catalog-view/catalog-list.jsx +173 -0
- package/src/components/catalog-view/catalog-page-item.jsx +110 -0
- package/src/components/catalog-view/catalog-turn-back-page-item.jsx +80 -0
- package/src/components/configurator/custom-configurator.jsx +77 -0
- package/src/components/configurator/project-configurator.jsx +120 -0
- package/src/components/export.js +36 -0
- package/src/components/firstsetting/button/styles.js +223 -0
- package/src/components/firstsetting/export.js +9 -0
- package/src/components/firstsetting/firstsetting-content-button.jsx +198 -0
- package/src/components/firstsetting/firstsetting-toggle-button.jsx +101 -0
- package/src/components/firstsetting/firstsetting.jsx +814 -0
- package/src/components/footerbar/button/ControlButton.jsx +43 -0
- package/src/components/footerbar/button/DirectionButton.jsx +54 -0
- package/src/components/footerbar/button/DirectionPanSpinButton.jsx +36 -0
- package/src/components/footerbar/button/ToggleButton.jsx +58 -0
- package/src/components/footerbar/button/ToggleConvertButton.jsx +48 -0
- package/src/components/footerbar/button/ToggleMeasureButton.jsx +33 -0
- package/src/components/footerbar/button/styles.js +217 -0
- package/src/components/footerbar/export.js +9 -0
- package/src/components/footerbar/footer-content-button.jsx +198 -0
- package/src/components/footerbar/footer-toggle-button.jsx +101 -0
- package/src/components/footerbar/footerbar.jsx +1103 -0
- package/src/components/footerbar/styles.js +263 -0
- package/src/components/header/button/MenuButton.jsx +46 -0
- package/src/components/header/button/SaveButton.jsx +54 -0
- package/src/components/header/button/styles.js +181 -0
- package/src/components/header/export.js +5 -0
- package/src/components/header/header.jsx +631 -0
- package/src/components/header/header.style.css +47 -0
- package/src/components/header/styles.js +320 -0
- package/src/components/login/Login.js +77 -0
- package/src/components/login/LoginForm/index.js +108 -0
- package/src/components/login/Register.js +82 -0
- package/src/components/login/RegisterForm/index.js +171 -0
- package/src/components/login/jwtService.js +201 -0
- package/src/components/login/style.css +158 -0
- package/src/components/login/style.scss +260 -0
- package/src/components/myprojects/export.js +5 -0
- package/src/components/myprojects/index.jsx +445 -0
- package/src/components/myprojects/styles.js +241 -0
- package/src/components/sidebar/custom-accordion.jsx +48 -0
- package/src/components/sidebar/export.js +15 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +73 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +101 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +149 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +316 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +108 -0
- package/src/components/sidebar/panel-element-editor/element-editor.jsx +1070 -0
- package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
- package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +104 -0
- package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +155 -0
- package/src/components/sidebar/panel-group-editor.jsx +272 -0
- package/src/components/sidebar/panel-groups.jsx +310 -0
- package/src/components/sidebar/panel-guides.jsx +192 -0
- package/src/components/sidebar/panel-layer-elements.jsx +298 -0
- package/src/components/sidebar/panel-layers.jsx +381 -0
- package/src/components/sidebar/panel.jsx +71 -0
- package/src/components/sidebar/sidebar.jsx +106 -0
- package/src/components/sidebar/toolbar-panel.jsx +139 -0
- package/src/components/sign/export.js +7 -0
- package/src/components/sign/main/index.jsx +523 -0
- package/src/components/sign/main/styles.js +163 -0
- package/src/components/toolbar/button/ControlButton.jsx +41 -0
- package/src/components/toolbar/button/DirectionButton.jsx +34 -0
- package/src/components/toolbar/button/RightButton.jsx +103 -0
- package/src/components/toolbar/button/ToggleButton.jsx +41 -0
- package/src/components/toolbar/button/index.jsx +55 -0
- package/src/components/toolbar/button/styles.js +127 -0
- package/src/components/toolbar/components/DoorStyleMenu.jsx +103 -0
- package/src/components/toolbar/components/Pricing.jsx +126 -0
- package/src/components/toolbar/components/ReviewForQuote.jsx +635 -0
- package/src/components/toolbar/export.js +21 -0
- package/src/components/toolbar/main/Alert.js +122 -0
- package/src/components/toolbar/main/TakePictureModal.jsx +104 -0
- package/src/components/toolbar/main/confirm-popup.jsx +99 -0
- package/src/components/toolbar/main/index.jsx +5627 -0
- package/src/components/toolbar/main/lShaped.json +311 -0
- package/src/components/toolbar/main/longNarrow.json +238 -0
- package/src/components/toolbar/main/myComponents.js +123 -0
- package/src/components/toolbar/main/oRectangle.json +220 -0
- package/src/components/toolbar/main/rectangle.json +238 -0
- package/src/components/toolbar/main/style.css +107 -0
- package/src/components/toolbar/main/styles.js +696 -0
- package/src/components/toolbar/plugin-item.jsx +123 -0
- package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +73 -0
- package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +102 -0
- package/src/components/toolbar/popup/appliance/index.jsx +83 -0
- package/src/components/toolbar/popup/autosaveprompt/index.jsx +150 -0
- package/src/components/toolbar/popup/autosaveprompt/styles.css +64 -0
- package/src/components/toolbar/popup/autosaveprompt/styles.js +40 -0
- package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +73 -0
- package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +119 -0
- package/src/components/toolbar/popup/cabinet/index.jsx +85 -0
- package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +63 -0
- package/src/components/toolbar/popup/doorStyle/index.jsx +71 -0
- package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +139 -0
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +2 -0
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +157 -0
- package/src/components/toolbar/popup/downloadsummary/index.jsx +643 -0
- package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +51 -0
- package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +175 -0
- package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +283 -0
- package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +2257 -0
- package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +93 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +132 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +2198 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +152 -0
- package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +149 -0
- package/src/components/toolbar/popup/downloadsummary/styles.css +177 -0
- package/src/components/toolbar/popup/downloadsummary/styles.js +453 -0
- package/src/components/toolbar/popup/finishingtouch/category/index.jsx +34 -0
- package/src/components/toolbar/popup/finishingtouch/index.jsx +58 -0
- package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +112 -0
- package/src/components/toolbar/popup/finishingtouch/product/index.jsx +116 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +101 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +254 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +311 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +238 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +220 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +238 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +86 -0
- package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +109 -0
- package/src/components/toolbar/popup/floorplan/index.jsx +60 -0
- package/src/components/toolbar/popup/index.jsx +241 -0
- package/src/components/toolbar/popup/newproject/index.jsx +59 -0
- package/src/components/toolbar/popup/newproject/styles.css +64 -0
- package/src/components/toolbar/popup/newproject/styles.js +41 -0
- package/src/components/toolbar/popup/product/appliance.jsx +54 -0
- package/src/components/toolbar/popup/product/cabinetproduct.jsx +15 -0
- package/src/components/toolbar/popup/product/doorstyle.jsx +58 -0
- package/src/components/toolbar/popup/product/doorstyleproduct.jsx +47 -0
- package/src/components/toolbar/popup/product/floor.jsx +36 -0
- package/src/components/toolbar/popup/product/floorproduct.jsx +42 -0
- package/src/components/toolbar/popup/product/index.jsx +36 -0
- package/src/components/toolbar/popup/product/primary.jsx +77 -0
- package/src/components/toolbar/popup/product/productline.jsx +93 -0
- package/src/components/toolbar/popup/product/reviewItem.jsx +427 -0
- package/src/components/toolbar/popup/product/reviewMolding.jsx +310 -0
- package/src/components/toolbar/popup/product/style.css +54 -0
- package/src/components/toolbar/popup/product/styles.js +260 -0
- package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +146 -0
- package/src/components/toolbar/popup/savedesign/index.jsx +495 -0
- package/src/components/toolbar/popup/savedesign/savedesign.style.css +16 -0
- package/src/components/toolbar/popup/savedesign/styles.js +151 -0
- package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +87 -0
- package/src/components/toolbar/popup/styles.js +909 -0
- package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +192 -0
- package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +96 -0
- package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +54 -0
- package/src/components/toolbar/popup/submitforquote/StepDots.jsx +25 -0
- package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +116 -0
- package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +38 -0
- package/src/components/toolbar/popup/submitforquote/index.jsx +698 -0
- package/src/components/toolbar/popup/submitforquote/styles.css +105 -0
- package/src/components/toolbar/popup/submitforquote/styles.js +294 -0
- package/src/components/toolbar/popup/submitprompt/index.jsx +89 -0
- package/src/components/toolbar/popup/submitprompt/styles.css +64 -0
- package/src/components/toolbar/popup/submitprompt/styles.js +42 -0
- package/src/components/toolbar/toolbar-button.jsx +90 -0
- package/src/components/toolbar/toolbar-load-button.jsx +36 -0
- package/src/components/toolbar/toolbar-save-button.jsx +32 -0
- package/src/components/wizardstep/button/styles.js +677 -0
- package/src/components/wizardstep/export.js +5 -0
- package/src/components/wizardstep/index.jsx +1372 -0
- package/src/components/wizardstep/styles.js +688 -0
- package/src/components/wizardstep/wizardstep-content-button.jsx +198 -0
- package/src/components/wizardstep/wizardstep-toggle-button.jsx +101 -0
- package/src/{_index.js → index.js} +4 -4
- package/src/renderer.jsx +466 -0
- package/src/actions/_export.js +0 -35
- package/src/components/_export.js +0 -11
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as S from './styles';
|
|
3
|
+
import Dialog from '@material-ui/core/Dialog';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import {
|
|
6
|
+
SECONDARY_PURPLE_COLOR,
|
|
7
|
+
TEXT_COLOR_NEUTRAL_2,
|
|
8
|
+
BG_COLOR_1,
|
|
9
|
+
API_SERVER_URL,
|
|
10
|
+
MODE_BACK_ELEVATION_VIEW,
|
|
11
|
+
MODE_FRONT_ELEVATION_VIEW,
|
|
12
|
+
MODE_LEFT_ELEVATION_VIEW,
|
|
13
|
+
MODE_RIGHT_ELEVATION_VIEW,
|
|
14
|
+
SHADE_LIGHT_PURPLE_COLOR,
|
|
15
|
+
LOCAL_STORAGE_CUSTOMER_INFO
|
|
16
|
+
} from '../../../../constants';
|
|
17
|
+
import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|
18
|
+
import Checkbox from '@material-ui/core/Checkbox';
|
|
19
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
20
|
+
import moment from 'moment';
|
|
21
|
+
import ShowCabinetInfo from './showCabinetInfo';
|
|
22
|
+
import Show2DView from './show2D/show2DView';
|
|
23
|
+
import Show3DView from './show3D/show3DView';
|
|
24
|
+
import ShowElevationView from './showElevation/showElevationView';
|
|
25
|
+
import ShowWarranty from './showWarranty';
|
|
26
|
+
import axios from 'axios';
|
|
27
|
+
import { DownloadSummaryContext } from './downloadSummaryContext';
|
|
28
|
+
import ls from 'localstorage-slim';
|
|
29
|
+
|
|
30
|
+
const StyledDialog = styled(Dialog)`
|
|
31
|
+
.MuiDialog-paperWidthSm {
|
|
32
|
+
border-radius: 5px;
|
|
33
|
+
max-width: 806px;
|
|
34
|
+
width: 90%;
|
|
35
|
+
height: 71%;
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
const DesignViewer = styled.div`
|
|
41
|
+
width: 55%;
|
|
42
|
+
border-style: solid;
|
|
43
|
+
border-width: 10px 10px 10px 20px;
|
|
44
|
+
border-color: rgba(0, 0, 0, 0);
|
|
45
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
position: relative;
|
|
48
|
+
|
|
49
|
+
::-webkit-scrollbar {
|
|
50
|
+
width: 2px;
|
|
51
|
+
position: absolute;
|
|
52
|
+
}
|
|
53
|
+
::-webkit-scrollbar-track-piece {
|
|
54
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
55
|
+
position: absolute;
|
|
56
|
+
}
|
|
57
|
+
::-webkit-scrollbar-thumb {
|
|
58
|
+
background-color: rgb(220, 220, 220);
|
|
59
|
+
border-radius: 5px;
|
|
60
|
+
transition: all 0.3s;
|
|
61
|
+
}
|
|
62
|
+
::-webkit-scrollbar-thumb:hover {
|
|
63
|
+
background-color: rgb(193, 202, 228);
|
|
64
|
+
border-radius: 5px;
|
|
65
|
+
transition: all 0.3s;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const DesignViewerMask = styled.div`
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
position: absolute;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
z-index: 20;
|
|
75
|
+
`;
|
|
76
|
+
const DesignViewerMaskInner = styled.div`
|
|
77
|
+
width: calc(100% - 12px);
|
|
78
|
+
height: 100%;
|
|
79
|
+
border-radius: 5px;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
z-index: 1;
|
|
83
|
+
box-shadow: 0 0 0 10px #7f7f7f;
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
const DesignViewerInnerContent = styled.div`
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
overflow: auto;
|
|
90
|
+
position: relative;
|
|
91
|
+
z-index: 0;
|
|
92
|
+
`;
|
|
93
|
+
|
|
94
|
+
const StyledMuiCheckbox = withStyles({
|
|
95
|
+
root: {
|
|
96
|
+
color: TEXT_COLOR_NEUTRAL_2,
|
|
97
|
+
'&$checked': {
|
|
98
|
+
color: SECONDARY_PURPLE_COLOR
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
checked: {}
|
|
102
|
+
})(props => <Checkbox color="default" {...props} />);
|
|
103
|
+
|
|
104
|
+
class DownloadSummaryPopup extends React.Component {
|
|
105
|
+
constructor(props) {
|
|
106
|
+
super(props);
|
|
107
|
+
|
|
108
|
+
let customerInfo = {};
|
|
109
|
+
try {
|
|
110
|
+
customerInfo = ls.get(LOCAL_STORAGE_CUSTOMER_INFO);
|
|
111
|
+
} catch (e) {
|
|
112
|
+
customerInfo = {};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this.state = {
|
|
116
|
+
email: customerInfo?.email || sessionStorage.getItem('email') || '',
|
|
117
|
+
emailfocusOn: false,
|
|
118
|
+
phone: sessionStorage.getItem('phone') || '',
|
|
119
|
+
phonefocusOn: false,
|
|
120
|
+
firstName:
|
|
121
|
+
customerInfo?.firstName || sessionStorage.getItem('firstName') || '',
|
|
122
|
+
firstNamefocusOn: false,
|
|
123
|
+
lastName:
|
|
124
|
+
customerInfo?.lastName || sessionStorage.getItem('lastName') || '',
|
|
125
|
+
lastNamefocusOn: false,
|
|
126
|
+
projectTitlefocusOn: false,
|
|
127
|
+
projectTitle: sessionStorage.getItem('projectTitle'),
|
|
128
|
+
check_3d: false,
|
|
129
|
+
check_2d: false,
|
|
130
|
+
check_list: false,
|
|
131
|
+
isLoading: false,
|
|
132
|
+
isLoading3D: false,
|
|
133
|
+
isLoadingElevation: {
|
|
134
|
+
front: false,
|
|
135
|
+
back: false,
|
|
136
|
+
right: false,
|
|
137
|
+
left: false
|
|
138
|
+
},
|
|
139
|
+
monkeyDocId: null
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
this.setIsLoading3D = this.setIsLoading3D.bind(this);
|
|
143
|
+
this.setIsLoadingElevation = this.setIsLoadingElevation.bind(this);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
setIsLoading3D(flag) {
|
|
147
|
+
this.setState({ isLoading3D: flag });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
setIsLoadingElevation(key, value) {
|
|
151
|
+
let temp = this.state.isLoadingElevation;
|
|
152
|
+
temp[key] = value;
|
|
153
|
+
this.setState({
|
|
154
|
+
isLoadingElevation: temp
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
_closePanel() {
|
|
159
|
+
this.setState({ check_3d: false, check_2d: false, check_list: false });
|
|
160
|
+
this.props.setDownloadPopupVisible(false);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
render() {
|
|
164
|
+
const { visible } = this.props;
|
|
165
|
+
const {
|
|
166
|
+
firstName,
|
|
167
|
+
firstNameFocusOn,
|
|
168
|
+
lastName,
|
|
169
|
+
lastNameFocusOn,
|
|
170
|
+
email,
|
|
171
|
+
emailFocusOn,
|
|
172
|
+
phone,
|
|
173
|
+
phoneFocusOn,
|
|
174
|
+
projectTitle,
|
|
175
|
+
projectTitleFocusOn,
|
|
176
|
+
check_3d,
|
|
177
|
+
check_2d,
|
|
178
|
+
check_list,
|
|
179
|
+
isLoading,
|
|
180
|
+
isLoading3D,
|
|
181
|
+
monkeyDocId
|
|
182
|
+
} = this.state;
|
|
183
|
+
|
|
184
|
+
const summaryContextValue = {
|
|
185
|
+
firstName: this.state.firstName,
|
|
186
|
+
lastName: this.state.lastName,
|
|
187
|
+
email: this.state.email,
|
|
188
|
+
phone: this.state.phone,
|
|
189
|
+
projectTitle: this.state.projectTitle,
|
|
190
|
+
projectId: sessionStorage.getItem('projectId')
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const pdfBrowserDownload = (fileName, pdfUrl) => {
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
let fileOutputLink = document.createElement('a');
|
|
196
|
+
|
|
197
|
+
fileOutputLink.setAttribute('download', fileName);
|
|
198
|
+
fileOutputLink.setAttribute('target', '_blank');
|
|
199
|
+
fileOutputLink.href = pdfUrl;
|
|
200
|
+
fileOutputLink.style.display = 'none';
|
|
201
|
+
document.body.appendChild(fileOutputLink);
|
|
202
|
+
setTimeout(() => {
|
|
203
|
+
fileOutputLink.click();
|
|
204
|
+
}, 100);
|
|
205
|
+
document.body.removeChild(fileOutputLink);
|
|
206
|
+
this.setState({
|
|
207
|
+
isModalVisible: false,
|
|
208
|
+
imageUri: '',
|
|
209
|
+
image: ''
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
document.removeEventListener('keydown', this.onKeyDown, false);
|
|
213
|
+
document.removeEventListener(
|
|
214
|
+
'mouseup',
|
|
215
|
+
this.onMouseUp_On_New_Save_SQ_DA,
|
|
216
|
+
false
|
|
217
|
+
);
|
|
218
|
+
}, 750);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const downloadSummaryHandler = () => {
|
|
222
|
+
// for imgCapture
|
|
223
|
+
let img3D = 'false';
|
|
224
|
+
let img2DPlain = 'false',
|
|
225
|
+
imgFront = 'false',
|
|
226
|
+
imgBack = 'false',
|
|
227
|
+
imgLeft = 'false',
|
|
228
|
+
imgRight = 'false';
|
|
229
|
+
|
|
230
|
+
// for header
|
|
231
|
+
const projectTitle = summaryContextValue.projectTitle;
|
|
232
|
+
const fName = summaryContextValue.firstName ?? '';
|
|
233
|
+
const lName = summaryContextValue.lastName ?? '';
|
|
234
|
+
const creator = (fName + ' ' + lName).trim();
|
|
235
|
+
const createDate = moment(new Date()).format('DD-MM-YYYY');
|
|
236
|
+
const projectID = summaryContextValue.projectId ?? '';
|
|
237
|
+
// for project save
|
|
238
|
+
const projectData = JSON.stringify(this.props.state.get('scene').toJS());
|
|
239
|
+
// for cabinet list
|
|
240
|
+
const cabinetList = window.productsInReview;
|
|
241
|
+
// for print checkboxes
|
|
242
|
+
const print_check = { check_3d, check_2d, check_list };
|
|
243
|
+
if (!this.state.isLoading) this.setState({ isLoading: true });
|
|
244
|
+
|
|
245
|
+
const wait_for_prepare_data = v => {
|
|
246
|
+
if (!v) {
|
|
247
|
+
setTimeout(downloadSummaryHandler, 1000);
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
return false;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
if (check_3d) {
|
|
254
|
+
if (wait_for_prepare_data(window.pdf3DPlain)) return;
|
|
255
|
+
img3D = window.pdf3DPlain;
|
|
256
|
+
}
|
|
257
|
+
if (check_2d) {
|
|
258
|
+
if (wait_for_prepare_data(window.pdf2DPlain)) return;
|
|
259
|
+
img2DPlain = window.pdf2DPlain;
|
|
260
|
+
|
|
261
|
+
if (
|
|
262
|
+
wait_for_prepare_data(
|
|
263
|
+
window.__elevationImg.MODE_FRONT_ELEVATION_VIEW
|
|
264
|
+
) ||
|
|
265
|
+
wait_for_prepare_data(
|
|
266
|
+
window.__elevationImg.MODE_BACK_ELEVATION_VIEW
|
|
267
|
+
) ||
|
|
268
|
+
wait_for_prepare_data(
|
|
269
|
+
window.__elevationImg.MODE_LEFT_ELEVATION_VIEW
|
|
270
|
+
) ||
|
|
271
|
+
wait_for_prepare_data(window.__elevationImg.MODE_RIGHT_ELEVATION_VIEW)
|
|
272
|
+
)
|
|
273
|
+
return;
|
|
274
|
+
imgFront = window.__elevationImg.MODE_FRONT_ELEVATION_VIEW;
|
|
275
|
+
imgBack = window.__elevationImg.MODE_BACK_ELEVATION_VIEW;
|
|
276
|
+
imgLeft = window.__elevationImg.MODE_LEFT_ELEVATION_VIEW;
|
|
277
|
+
imgRight = window.__elevationImg.MODE_RIGHT_ELEVATION_VIEW;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
axios
|
|
281
|
+
.post(`${API_SERVER_URL}/api/project/downloadPDF`, {
|
|
282
|
+
monkeyDocId: monkeyDocId,
|
|
283
|
+
img3D: img3D,
|
|
284
|
+
img2DElevation: [img2DPlain, imgFront, imgBack, imgLeft, imgRight],
|
|
285
|
+
projectTitle: projectTitle,
|
|
286
|
+
creator: creator,
|
|
287
|
+
createDate: createDate,
|
|
288
|
+
summaryID: projectID + createDate,
|
|
289
|
+
projectID: projectID,
|
|
290
|
+
projectData: projectData,
|
|
291
|
+
cabinetList: cabinetList,
|
|
292
|
+
whatToPrint: print_check
|
|
293
|
+
})
|
|
294
|
+
.then(async res => {
|
|
295
|
+
const respData = res.data;
|
|
296
|
+
if (respData.success) {
|
|
297
|
+
this.setState({
|
|
298
|
+
isLoading: false,
|
|
299
|
+
monkeyDocId: respData.monkeyDocId
|
|
300
|
+
});
|
|
301
|
+
pdfBrowserDownload(respData.filename, respData.download_url);
|
|
302
|
+
} else {
|
|
303
|
+
this.setState({ isLoading: false });
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
return (
|
|
309
|
+
<DownloadSummaryContext.Provider value={summaryContextValue}>
|
|
310
|
+
<div>
|
|
311
|
+
<StyledDialog
|
|
312
|
+
id="showInfo"
|
|
313
|
+
open={visible}
|
|
314
|
+
onClose={() => this._closePanel()}
|
|
315
|
+
>
|
|
316
|
+
{isLoading && (
|
|
317
|
+
<div
|
|
318
|
+
style={{
|
|
319
|
+
position: 'absolute',
|
|
320
|
+
alignItems: 'center',
|
|
321
|
+
width: '100%',
|
|
322
|
+
height: '100%',
|
|
323
|
+
opacity: '0.8',
|
|
324
|
+
background: 'gray',
|
|
325
|
+
zIndex: '10',
|
|
326
|
+
justifyContent: 'center',
|
|
327
|
+
display: 'flex'
|
|
328
|
+
}}
|
|
329
|
+
>
|
|
330
|
+
<img
|
|
331
|
+
style={{ animation: 'spin 2s linear infinite' }}
|
|
332
|
+
src={'/assets/img/loading_large.gif'}
|
|
333
|
+
alt="img"
|
|
334
|
+
/>
|
|
335
|
+
</div>
|
|
336
|
+
)}
|
|
337
|
+
<div
|
|
338
|
+
style={{
|
|
339
|
+
display: 'flex',
|
|
340
|
+
width: '100%',
|
|
341
|
+
userSelect: 'none ',
|
|
342
|
+
height: '100%'
|
|
343
|
+
}}
|
|
344
|
+
>
|
|
345
|
+
<div
|
|
346
|
+
style={{
|
|
347
|
+
width: '45%',
|
|
348
|
+
display: 'flex',
|
|
349
|
+
padding: '40px 40px 40px 40px',
|
|
350
|
+
flexDirection: 'column'
|
|
351
|
+
}}
|
|
352
|
+
>
|
|
353
|
+
<S.DialogTitle>Download Summary</S.DialogTitle>
|
|
354
|
+
<S.DialogContent style={{ margin: '10px 0' }}>
|
|
355
|
+
You are almost there, customize your summary based on your
|
|
356
|
+
requirements.
|
|
357
|
+
</S.DialogContent>
|
|
358
|
+
<div
|
|
359
|
+
style={{
|
|
360
|
+
height: '80%',
|
|
361
|
+
display: 'flex',
|
|
362
|
+
flexDirection: 'column',
|
|
363
|
+
overflowY: 'scroll'
|
|
364
|
+
}}
|
|
365
|
+
>
|
|
366
|
+
{sessionStorage.getItem('email') === null && (
|
|
367
|
+
<div style={{}}>
|
|
368
|
+
<S.StyledInputWrapper>
|
|
369
|
+
<S.StyledInput
|
|
370
|
+
value={firstName}
|
|
371
|
+
onChange={e =>
|
|
372
|
+
this.setState({ firstName: e.target.value })
|
|
373
|
+
}
|
|
374
|
+
onFocus={e =>
|
|
375
|
+
this.setState({ firstNameFocusOn: true })
|
|
376
|
+
}
|
|
377
|
+
onBlur={e =>
|
|
378
|
+
this.setState({ firstNameFocusOn: false })
|
|
379
|
+
}
|
|
380
|
+
placeholder={
|
|
381
|
+
firstNameFocusOn ? 'Enter First Name' : 'First Name'
|
|
382
|
+
}
|
|
383
|
+
required
|
|
384
|
+
/>
|
|
385
|
+
{(firstNameFocusOn || !!firstName.length) && (
|
|
386
|
+
<S.StyledInputHeadLabel
|
|
387
|
+
style={{
|
|
388
|
+
color: !firstNameFocusOn && TEXT_COLOR_NEUTRAL_2
|
|
389
|
+
}}
|
|
390
|
+
>
|
|
391
|
+
First Name
|
|
392
|
+
</S.StyledInputHeadLabel>
|
|
393
|
+
)}
|
|
394
|
+
{!!firstName.length && (
|
|
395
|
+
<S.PlusImage
|
|
396
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
397
|
+
onClick={() => this.setState({ firstName: '' })}
|
|
398
|
+
/>
|
|
399
|
+
)}
|
|
400
|
+
</S.StyledInputWrapper>
|
|
401
|
+
<S.StyledInputWrapper>
|
|
402
|
+
<S.StyledInput
|
|
403
|
+
value={lastName}
|
|
404
|
+
onChange={e =>
|
|
405
|
+
this.setState({ lastName: e.target.value })
|
|
406
|
+
}
|
|
407
|
+
onFocus={e =>
|
|
408
|
+
this.setState({ lastNameFocusOn: true })
|
|
409
|
+
}
|
|
410
|
+
onBlur={e =>
|
|
411
|
+
this.setState({ lastNameFocusOn: false })
|
|
412
|
+
}
|
|
413
|
+
placeholder={
|
|
414
|
+
lastNameFocusOn ? 'Enter Last Name' : 'Last Name'
|
|
415
|
+
}
|
|
416
|
+
required
|
|
417
|
+
/>
|
|
418
|
+
{(lastNameFocusOn || !!lastName.length) && (
|
|
419
|
+
<S.StyledInputHeadLabel
|
|
420
|
+
style={{
|
|
421
|
+
color: !lastNameFocusOn && TEXT_COLOR_NEUTRAL_2
|
|
422
|
+
}}
|
|
423
|
+
>
|
|
424
|
+
Last Name
|
|
425
|
+
</S.StyledInputHeadLabel>
|
|
426
|
+
)}
|
|
427
|
+
{!!lastName.length && (
|
|
428
|
+
<S.PlusImage
|
|
429
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
430
|
+
onClick={() => this.setState({ lastName: '' })}
|
|
431
|
+
/>
|
|
432
|
+
)}
|
|
433
|
+
</S.StyledInputWrapper>
|
|
434
|
+
<S.StyledInputWrapper>
|
|
435
|
+
<S.StyledInput
|
|
436
|
+
value={email}
|
|
437
|
+
onChange={e =>
|
|
438
|
+
this.setState({ email: e.target.value })
|
|
439
|
+
}
|
|
440
|
+
onFocus={e => this.setState({ emailFocusOn: true })}
|
|
441
|
+
onBlur={e => this.setState({ emailFocusOn: false })}
|
|
442
|
+
placeholder={emailFocusOn ? 'Enter Email' : 'Email'}
|
|
443
|
+
required
|
|
444
|
+
/>
|
|
445
|
+
{(emailFocusOn || !!email.length) && (
|
|
446
|
+
<S.StyledInputHeadLabel
|
|
447
|
+
style={{
|
|
448
|
+
color: !emailFocusOn && TEXT_COLOR_NEUTRAL_2
|
|
449
|
+
}}
|
|
450
|
+
>
|
|
451
|
+
Email
|
|
452
|
+
</S.StyledInputHeadLabel>
|
|
453
|
+
)}
|
|
454
|
+
{!!email.length && (
|
|
455
|
+
<S.PlusImage
|
|
456
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
457
|
+
onClick={() => this.setState({ email: '' })}
|
|
458
|
+
/>
|
|
459
|
+
)}
|
|
460
|
+
</S.StyledInputWrapper>
|
|
461
|
+
<S.StyledInputWrapper>
|
|
462
|
+
<S.StyledInput
|
|
463
|
+
value={phone}
|
|
464
|
+
onChange={e =>
|
|
465
|
+
this.setState({ phone: e.target.value })
|
|
466
|
+
}
|
|
467
|
+
onFocus={() => this.setState({ phoneFocusOn: true })}
|
|
468
|
+
onBlur={() => this.setState({ phoneFocusOn: false })}
|
|
469
|
+
placeholder={
|
|
470
|
+
phoneFocusOn ? 'Enter Phone Number' : 'Phone Number'
|
|
471
|
+
}
|
|
472
|
+
required
|
|
473
|
+
/>
|
|
474
|
+
{(phoneFocusOn || !!phone.length) && (
|
|
475
|
+
<S.StyledInputHeadLabel
|
|
476
|
+
style={{
|
|
477
|
+
color: !phoneFocusOn && TEXT_COLOR_NEUTRAL_2
|
|
478
|
+
}}
|
|
479
|
+
>
|
|
480
|
+
Phone Number
|
|
481
|
+
</S.StyledInputHeadLabel>
|
|
482
|
+
)}
|
|
483
|
+
{!!phone.length && (
|
|
484
|
+
<S.PlusImage
|
|
485
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
486
|
+
onClick={() => this.setState({ phone: '' })}
|
|
487
|
+
/>
|
|
488
|
+
)}
|
|
489
|
+
</S.StyledInputWrapper>
|
|
490
|
+
<S.StyledInputWrapper>
|
|
491
|
+
<S.StyledInput
|
|
492
|
+
value={projectTitle}
|
|
493
|
+
onChange={e =>
|
|
494
|
+
this.setState({ projectTitle: e.target.value })
|
|
495
|
+
}
|
|
496
|
+
onFocus={() =>
|
|
497
|
+
this.setState({ projectTitleFocusOn: true })
|
|
498
|
+
}
|
|
499
|
+
onBlur={() =>
|
|
500
|
+
this.setState({ projectTitleFocusOn: false })
|
|
501
|
+
}
|
|
502
|
+
placeholder={
|
|
503
|
+
projectTitleFocusOn
|
|
504
|
+
? 'Enter Project Name'
|
|
505
|
+
: 'Project Name'
|
|
506
|
+
}
|
|
507
|
+
required
|
|
508
|
+
/>
|
|
509
|
+
{(projectTitleFocusOn || !!projectTitle.length) && (
|
|
510
|
+
<S.StyledInputHeadLabel
|
|
511
|
+
style={{
|
|
512
|
+
color:
|
|
513
|
+
!projectTitleFocusOn && TEXT_COLOR_NEUTRAL_2
|
|
514
|
+
}}
|
|
515
|
+
>
|
|
516
|
+
Project Name
|
|
517
|
+
</S.StyledInputHeadLabel>
|
|
518
|
+
)}
|
|
519
|
+
{!!projectTitle.length && (
|
|
520
|
+
<S.PlusImage
|
|
521
|
+
maskImage="/assets/img/svg/bottombar/arrow-plus.svg"
|
|
522
|
+
onClick={() => this.setState({ projectTitle: '' })}
|
|
523
|
+
/>
|
|
524
|
+
)}
|
|
525
|
+
</S.StyledInputWrapper>
|
|
526
|
+
</div>
|
|
527
|
+
)}
|
|
528
|
+
<S.DialogContent style={{ margin: '4px 0px' }}>
|
|
529
|
+
What you want to print:
|
|
530
|
+
</S.DialogContent>
|
|
531
|
+
<FormControlLabel
|
|
532
|
+
style={{ margin: '6px 0px' }}
|
|
533
|
+
control={
|
|
534
|
+
<StyledMuiCheckbox
|
|
535
|
+
style={{ padding: 'unset' }}
|
|
536
|
+
checked={check_3d}
|
|
537
|
+
onChange={() => this.setState({ check_3d: !check_3d })}
|
|
538
|
+
value={check_3d}
|
|
539
|
+
/>
|
|
540
|
+
}
|
|
541
|
+
label={
|
|
542
|
+
<S.DialogContents>
|
|
543
|
+
3D render of the kitchen
|
|
544
|
+
</S.DialogContents>
|
|
545
|
+
}
|
|
546
|
+
/>
|
|
547
|
+
<FormControlLabel
|
|
548
|
+
style={{ margin: '6px 0px' }}
|
|
549
|
+
control={
|
|
550
|
+
<StyledMuiCheckbox
|
|
551
|
+
style={{ padding: 'unset' }}
|
|
552
|
+
checked={check_2d}
|
|
553
|
+
onChange={() => this.setState({ check_2d: !check_2d })}
|
|
554
|
+
value={check_2d}
|
|
555
|
+
/>
|
|
556
|
+
}
|
|
557
|
+
label={
|
|
558
|
+
<S.DialogContents>
|
|
559
|
+
2D floor plan and elevations technical view
|
|
560
|
+
</S.DialogContents>
|
|
561
|
+
}
|
|
562
|
+
/>
|
|
563
|
+
<FormControlLabel
|
|
564
|
+
style={{ margin: '6px 0px' }}
|
|
565
|
+
control={
|
|
566
|
+
<StyledMuiCheckbox
|
|
567
|
+
style={{ padding: 'unset' }}
|
|
568
|
+
checked={check_list}
|
|
569
|
+
onChange={() =>
|
|
570
|
+
this.setState({ check_list: !check_list })
|
|
571
|
+
}
|
|
572
|
+
value={check_list}
|
|
573
|
+
/>
|
|
574
|
+
}
|
|
575
|
+
label={
|
|
576
|
+
<S.DialogContents>
|
|
577
|
+
List of parts with quantities and pricing
|
|
578
|
+
</S.DialogContents>
|
|
579
|
+
}
|
|
580
|
+
/>
|
|
581
|
+
</div>
|
|
582
|
+
<S.SaveBox onClick={downloadSummaryHandler}>
|
|
583
|
+
<S.SelectTitle style={{ color: BG_COLOR_1 }}>
|
|
584
|
+
Save & Download Summary
|
|
585
|
+
</S.SelectTitle>
|
|
586
|
+
</S.SaveBox>
|
|
587
|
+
</div>
|
|
588
|
+
<DesignViewer>
|
|
589
|
+
<DesignViewerMask>
|
|
590
|
+
<DesignViewerMaskInner />
|
|
591
|
+
</DesignViewerMask>
|
|
592
|
+
<DesignViewerInnerContent>
|
|
593
|
+
<div style={{ paddingRight: '10px' }}>
|
|
594
|
+
{check_3d && (
|
|
595
|
+
<Show3DView
|
|
596
|
+
props={this.props}
|
|
597
|
+
setIsLoading3D={this.setIsLoading3D}
|
|
598
|
+
/>
|
|
599
|
+
)}
|
|
600
|
+
{check_2d && <Show2DView props={this.props} />}
|
|
601
|
+
{check_2d && [
|
|
602
|
+
<ShowElevationView
|
|
603
|
+
props={this.props}
|
|
604
|
+
mode={MODE_FRONT_ELEVATION_VIEW}
|
|
605
|
+
setIsLoadingElevation={this.setIsLoadingElevation}
|
|
606
|
+
/>,
|
|
607
|
+
<ShowElevationView
|
|
608
|
+
props={this.props}
|
|
609
|
+
mode={MODE_BACK_ELEVATION_VIEW}
|
|
610
|
+
setIsLoadingElevation={this.setIsLoadingElevation}
|
|
611
|
+
/>,
|
|
612
|
+
<ShowElevationView
|
|
613
|
+
props={this.props}
|
|
614
|
+
mode={MODE_LEFT_ELEVATION_VIEW}
|
|
615
|
+
setIsLoadingElevation={this.setIsLoadingElevation}
|
|
616
|
+
/>,
|
|
617
|
+
<ShowElevationView
|
|
618
|
+
props={this.props}
|
|
619
|
+
mode={MODE_RIGHT_ELEVATION_VIEW}
|
|
620
|
+
setIsLoadingElevation={this.setIsLoadingElevation}
|
|
621
|
+
/>
|
|
622
|
+
]}
|
|
623
|
+
{check_list && (
|
|
624
|
+
<ShowCabinetInfo
|
|
625
|
+
productDATA={window.productData || null}
|
|
626
|
+
totalPrice={window.totalPrice}
|
|
627
|
+
config={this.props.logoImage}
|
|
628
|
+
/>
|
|
629
|
+
)}
|
|
630
|
+
<ShowWarranty config={this.props.logoImage} />
|
|
631
|
+
</div>
|
|
632
|
+
</DesignViewerInnerContent>
|
|
633
|
+
</DesignViewer>
|
|
634
|
+
</div>
|
|
635
|
+
</StyledDialog>
|
|
636
|
+
</div>
|
|
637
|
+
</DownloadSummaryContext.Provider>
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export default DownloadSummaryPopup;
|
|
643
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DownloadSummaryTemp from '../downloadSummaryTemp';
|
|
3
|
+
import * as constants from '../../../../../constants';
|
|
4
|
+
import Viewer2DDownLoad from './viewer2DDownLoad';
|
|
5
|
+
|
|
6
|
+
const Show2DView = ({ props }) => {
|
|
7
|
+
return (
|
|
8
|
+
<DownloadSummaryTemp config={props.logoImage}>
|
|
9
|
+
<div style={{ marginBottom: '32px' }}>
|
|
10
|
+
<div
|
|
11
|
+
style={{
|
|
12
|
+
marginTop: '20px',
|
|
13
|
+
color: '#000F33',
|
|
14
|
+
fontSize: '17px',
|
|
15
|
+
fontFamily: constants.DEFAULT_FONT_FAMILY,
|
|
16
|
+
fontWeight: '700',
|
|
17
|
+
lineHeight: '45.9px',
|
|
18
|
+
wordWrap: 'break-word'
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
{constants.TWO_D_FLOOR_PLAN}
|
|
22
|
+
</div>
|
|
23
|
+
<div
|
|
24
|
+
style={{
|
|
25
|
+
marginTop: 7,
|
|
26
|
+
color: '#434D63',
|
|
27
|
+
fontSize: '9px',
|
|
28
|
+
fontFamily: constants.DEFAULT_FONT_FAMILY,
|
|
29
|
+
fontWeight: '600',
|
|
30
|
+
lineHeight: '15px',
|
|
31
|
+
wordWrap: 'break-word'
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
{constants.TECHNICAL_VIEW}
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div style={{ height: 412 }}>
|
|
38
|
+
<div style={{ transform: `scale(0.5, 0.5)`, width: 6, height: 2 }}>
|
|
39
|
+
<Viewer2DDownLoad
|
|
40
|
+
state={props.state}
|
|
41
|
+
catalog={props.catalog}
|
|
42
|
+
width={682}
|
|
43
|
+
height={560}
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</DownloadSummaryTemp>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default Show2DView;
|