kitchen-simulator 5.0.0-test.17 → 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.
Files changed (206) hide show
  1. package/package.json +8 -18
  2. package/src/@history.js +3 -0
  3. package/src/CrossSignOn.jsx +94 -0
  4. package/src/KitchenConfigurator.jsx +1526 -0
  5. package/src/KitchenConfiguratorApp.jsx +1 -1
  6. package/src/_KitchenConfigurator.jsx +3 -91
  7. package/src/components/atoms/Snackbar/index.jsx +43 -0
  8. package/src/components/atoms/radio-button/index.jsx +20 -0
  9. package/src/components/atoms/radio-button/styles.js +56 -0
  10. package/src/components/button/MainButton.jsx +157 -0
  11. package/src/components/button/ToggleMeasureButton.jsx +65 -0
  12. package/src/components/catalog-view/catalog-breadcrumb.jsx +53 -0
  13. package/src/components/catalog-view/catalog-item.jsx +229 -0
  14. package/src/components/catalog-view/catalog-list.jsx +173 -0
  15. package/src/components/catalog-view/catalog-page-item.jsx +110 -0
  16. package/src/components/catalog-view/catalog-turn-back-page-item.jsx +80 -0
  17. package/src/components/configurator/custom-configurator.jsx +77 -0
  18. package/src/components/configurator/project-configurator.jsx +120 -0
  19. package/src/components/content.jsx +136 -0
  20. package/src/components/export.js +36 -0
  21. package/src/components/firstsetting/button/styles.js +223 -0
  22. package/src/components/firstsetting/export.js +9 -0
  23. package/src/components/firstsetting/firstsetting-content-button.jsx +198 -0
  24. package/src/components/firstsetting/firstsetting-toggle-button.jsx +101 -0
  25. package/src/components/firstsetting/firstsetting.jsx +814 -0
  26. package/src/components/footerbar/button/ControlButton.jsx +43 -0
  27. package/src/components/footerbar/button/DirectionButton.jsx +54 -0
  28. package/src/components/footerbar/button/DirectionPanSpinButton.jsx +36 -0
  29. package/src/components/footerbar/button/ToggleButton.jsx +58 -0
  30. package/src/components/footerbar/button/ToggleConvertButton.jsx +48 -0
  31. package/src/components/footerbar/button/ToggleMeasureButton.jsx +33 -0
  32. package/src/components/footerbar/button/styles.js +217 -0
  33. package/src/components/footerbar/export.js +9 -0
  34. package/src/components/footerbar/footer-content-button.jsx +198 -0
  35. package/src/components/footerbar/footer-toggle-button.jsx +101 -0
  36. package/src/components/footerbar/footerbar.jsx +1103 -0
  37. package/src/components/footerbar/styles.js +263 -0
  38. package/src/components/header/button/MenuButton.jsx +46 -0
  39. package/src/components/header/button/SaveButton.jsx +54 -0
  40. package/src/components/header/button/styles.js +181 -0
  41. package/src/components/header/export.js +5 -0
  42. package/src/components/header/header.jsx +631 -0
  43. package/src/components/header/header.style.css +47 -0
  44. package/src/components/header/styles.js +320 -0
  45. package/src/components/login/Login.js +77 -0
  46. package/src/components/login/LoginForm/index.js +108 -0
  47. package/src/components/login/Register.js +82 -0
  48. package/src/components/login/RegisterForm/index.js +171 -0
  49. package/src/components/login/jwtService.js +201 -0
  50. package/src/components/login/style.css +158 -0
  51. package/src/components/login/style.scss +260 -0
  52. package/src/components/molecules/slider/index.jsx +15 -0
  53. package/src/components/molecules/slider/styles.js +0 -0
  54. package/src/components/molecules/slider/styles.scss +3 -0
  55. package/src/components/myprojects/export.js +5 -0
  56. package/src/components/myprojects/index.jsx +445 -0
  57. package/src/components/myprojects/styles.js +241 -0
  58. package/src/components/sidebar/custom-accordion.jsx +48 -0
  59. package/src/components/sidebar/export.js +15 -0
  60. package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +73 -0
  61. package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +101 -0
  62. package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +149 -0
  63. package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +316 -0
  64. package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +108 -0
  65. package/src/components/sidebar/panel-element-editor/element-editor.jsx +1070 -0
  66. package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
  67. package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +104 -0
  68. package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +155 -0
  69. package/src/components/sidebar/panel-group-editor.jsx +272 -0
  70. package/src/components/sidebar/panel-groups.jsx +310 -0
  71. package/src/components/sidebar/panel-guides.jsx +192 -0
  72. package/src/components/sidebar/panel-layer-elements.jsx +298 -0
  73. package/src/components/sidebar/panel-layers.jsx +381 -0
  74. package/src/components/sidebar/panel.jsx +71 -0
  75. package/src/components/sidebar/sidebar.jsx +106 -0
  76. package/src/components/sidebar/toolbar-panel.jsx +139 -0
  77. package/src/components/sign/export.js +7 -0
  78. package/src/components/sign/main/index.jsx +523 -0
  79. package/src/components/sign/main/styles.js +163 -0
  80. package/src/components/style/button.jsx +95 -0
  81. package/src/components/style/cancel-button.jsx +20 -0
  82. package/src/components/style/content-container.jsx +29 -0
  83. package/src/components/style/content-title.jsx +20 -0
  84. package/src/components/style/delete-button.jsx +23 -0
  85. package/src/components/style/export.jsx +48 -0
  86. package/src/components/style/form-block.jsx +13 -0
  87. package/src/components/style/form-color-input.jsx +27 -0
  88. package/src/components/style/form-label.jsx +15 -0
  89. package/src/components/style/form-number-input.jsx +196 -0
  90. package/src/components/style/form-number-input_2.jsx +191 -0
  91. package/src/components/style/form-select.jsx +38 -0
  92. package/src/components/style/form-slider.jsx +36 -0
  93. package/src/components/style/form-submit-button.jsx +23 -0
  94. package/src/components/style/form-text-input.jsx +65 -0
  95. package/src/components/toolbar/button/ControlButton.jsx +41 -0
  96. package/src/components/toolbar/button/DirectionButton.jsx +34 -0
  97. package/src/components/toolbar/button/RightButton.jsx +103 -0
  98. package/src/components/toolbar/button/ToggleButton.jsx +41 -0
  99. package/src/components/toolbar/button/index.jsx +55 -0
  100. package/src/components/toolbar/button/styles.js +127 -0
  101. package/src/components/toolbar/components/DoorStyleMenu.jsx +103 -0
  102. package/src/components/toolbar/components/Pricing.jsx +126 -0
  103. package/src/components/toolbar/components/ReviewForQuote.jsx +635 -0
  104. package/src/components/toolbar/export.js +21 -0
  105. package/src/components/toolbar/main/Alert.js +122 -0
  106. package/src/components/toolbar/main/TakePictureModal.jsx +104 -0
  107. package/src/components/toolbar/main/confirm-popup.jsx +99 -0
  108. package/src/components/toolbar/main/index.jsx +5627 -0
  109. package/src/components/toolbar/main/lShaped.json +311 -0
  110. package/src/components/toolbar/main/longNarrow.json +238 -0
  111. package/src/components/toolbar/main/myComponents.js +123 -0
  112. package/src/components/toolbar/main/oRectangle.json +220 -0
  113. package/src/components/toolbar/main/rectangle.json +238 -0
  114. package/src/components/toolbar/main/style.css +107 -0
  115. package/src/components/toolbar/main/styles.js +696 -0
  116. package/src/components/toolbar/plugin-item.jsx +123 -0
  117. package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +73 -0
  118. package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +102 -0
  119. package/src/components/toolbar/popup/appliance/index.jsx +83 -0
  120. package/src/components/toolbar/popup/autosaveprompt/index.jsx +150 -0
  121. package/src/components/toolbar/popup/autosaveprompt/styles.css +64 -0
  122. package/src/components/toolbar/popup/autosaveprompt/styles.js +40 -0
  123. package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +73 -0
  124. package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +119 -0
  125. package/src/components/toolbar/popup/cabinet/index.jsx +85 -0
  126. package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +63 -0
  127. package/src/components/toolbar/popup/doorStyle/index.jsx +71 -0
  128. package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +139 -0
  129. package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +2 -0
  130. package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +157 -0
  131. package/src/components/toolbar/popup/downloadsummary/index.jsx +643 -0
  132. package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +51 -0
  133. package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +175 -0
  134. package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +283 -0
  135. package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +2257 -0
  136. package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +93 -0
  137. package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +132 -0
  138. package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +2198 -0
  139. package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +152 -0
  140. package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +149 -0
  141. package/src/components/toolbar/popup/downloadsummary/styles.css +177 -0
  142. package/src/components/toolbar/popup/downloadsummary/styles.js +453 -0
  143. package/src/components/toolbar/popup/finishingtouch/category/index.jsx +34 -0
  144. package/src/components/toolbar/popup/finishingtouch/index.jsx +58 -0
  145. package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +112 -0
  146. package/src/components/toolbar/popup/finishingtouch/product/index.jsx +116 -0
  147. package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +101 -0
  148. package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +254 -0
  149. package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +311 -0
  150. package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +238 -0
  151. package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +220 -0
  152. package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +238 -0
  153. package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +86 -0
  154. package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +109 -0
  155. package/src/components/toolbar/popup/floorplan/index.jsx +60 -0
  156. package/src/components/toolbar/popup/index.jsx +241 -0
  157. package/src/components/toolbar/popup/newproject/index.jsx +59 -0
  158. package/src/components/toolbar/popup/newproject/styles.css +64 -0
  159. package/src/components/toolbar/popup/newproject/styles.js +41 -0
  160. package/src/components/toolbar/popup/product/appliance.jsx +54 -0
  161. package/src/components/toolbar/popup/product/cabinetproduct.jsx +15 -0
  162. package/src/components/toolbar/popup/product/doorstyle.jsx +58 -0
  163. package/src/components/toolbar/popup/product/doorstyleproduct.jsx +47 -0
  164. package/src/components/toolbar/popup/product/floor.jsx +36 -0
  165. package/src/components/toolbar/popup/product/floorproduct.jsx +42 -0
  166. package/src/components/toolbar/popup/product/index.jsx +36 -0
  167. package/src/components/toolbar/popup/product/primary.jsx +77 -0
  168. package/src/components/toolbar/popup/product/productline.jsx +93 -0
  169. package/src/components/toolbar/popup/product/reviewItem.jsx +427 -0
  170. package/src/components/toolbar/popup/product/reviewMolding.jsx +310 -0
  171. package/src/components/toolbar/popup/product/style.css +54 -0
  172. package/src/components/toolbar/popup/product/styles.js +260 -0
  173. package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +146 -0
  174. package/src/components/toolbar/popup/savedesign/index.jsx +495 -0
  175. package/src/components/toolbar/popup/savedesign/savedesign.style.css +16 -0
  176. package/src/components/toolbar/popup/savedesign/styles.js +151 -0
  177. package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +87 -0
  178. package/src/components/toolbar/popup/styles.js +909 -0
  179. package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +192 -0
  180. package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +96 -0
  181. package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +54 -0
  182. package/src/components/toolbar/popup/submitforquote/StepDots.jsx +25 -0
  183. package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +116 -0
  184. package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +38 -0
  185. package/src/components/toolbar/popup/submitforquote/index.jsx +698 -0
  186. package/src/components/toolbar/popup/submitforquote/styles.css +105 -0
  187. package/src/components/toolbar/popup/submitforquote/styles.js +294 -0
  188. package/src/components/toolbar/popup/submitprompt/index.jsx +89 -0
  189. package/src/components/toolbar/popup/submitprompt/styles.css +64 -0
  190. package/src/components/toolbar/popup/submitprompt/styles.js +42 -0
  191. package/src/components/toolbar/toolbar-button.jsx +90 -0
  192. package/src/components/toolbar/toolbar-load-button.jsx +36 -0
  193. package/src/components/toolbar/toolbar-save-button.jsx +32 -0
  194. package/src/components/tutorial-view/Modal.jsx +584 -0
  195. package/src/components/tutorial-view/style.css +111 -0
  196. package/src/components/tutorial-view/styles.js +65 -0
  197. package/src/components/wizardstep/button/styles.js +677 -0
  198. package/src/components/wizardstep/export.js +5 -0
  199. package/src/components/wizardstep/index.jsx +1372 -0
  200. package/src/components/wizardstep/styles.js +688 -0
  201. package/src/components/wizardstep/wizardstep-content-button.jsx +198 -0
  202. package/src/components/wizardstep/wizardstep-toggle-button.jsx +101 -0
  203. package/src/{_index.js → index.js} +4 -4
  204. package/src/renderer.jsx +466 -0
  205. package/src/actions/_export.js +0 -35
  206. 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;