kitchen-simulator 5.0.0-test.6 → 5.0.0-test.8
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 +23 -3
- package/src/components/_export.js +11 -0
- package/src/components/viewer3d/scene-creator.js +23 -26
- package/src/components/viewer3d/viewer3d.js +18 -18
- package/src/components/catalog-view/catalog-breadcrumb.jsx +0 -53
- package/src/components/catalog-view/catalog-item.jsx +0 -229
- package/src/components/catalog-view/catalog-list.jsx +0 -173
- package/src/components/catalog-view/catalog-page-item.jsx +0 -110
- package/src/components/catalog-view/catalog-turn-back-page-item.jsx +0 -80
- package/src/components/configurator/custom-configurator.jsx +0 -77
- package/src/components/configurator/project-configurator.jsx +0 -120
- package/src/components/export.js +0 -36
- package/src/components/firstsetting/button/styles.js +0 -223
- package/src/components/firstsetting/export.js +0 -9
- package/src/components/firstsetting/firstsetting-content-button.jsx +0 -198
- package/src/components/firstsetting/firstsetting-toggle-button.jsx +0 -101
- package/src/components/firstsetting/firstsetting.jsx +0 -814
- package/src/components/footerbar/button/ControlButton.jsx +0 -43
- package/src/components/footerbar/button/DirectionButton.jsx +0 -54
- package/src/components/footerbar/button/DirectionPanSpinButton.jsx +0 -36
- package/src/components/footerbar/button/ToggleButton.jsx +0 -58
- package/src/components/footerbar/button/ToggleConvertButton.jsx +0 -48
- package/src/components/footerbar/button/ToggleMeasureButton.jsx +0 -33
- package/src/components/footerbar/button/styles.js +0 -217
- package/src/components/footerbar/export.js +0 -9
- package/src/components/footerbar/footer-content-button.jsx +0 -198
- package/src/components/footerbar/footer-toggle-button.jsx +0 -101
- package/src/components/footerbar/footerbar.jsx +0 -1103
- package/src/components/footerbar/styles.js +0 -263
- package/src/components/header/button/MenuButton.jsx +0 -46
- package/src/components/header/button/SaveButton.jsx +0 -54
- package/src/components/header/button/styles.js +0 -181
- package/src/components/header/export.js +0 -5
- package/src/components/header/header.jsx +0 -631
- package/src/components/header/header.style.css +0 -47
- package/src/components/header/styles.js +0 -320
- package/src/components/login/Login.js +0 -77
- package/src/components/login/LoginForm/index.js +0 -108
- package/src/components/login/Register.js +0 -83
- package/src/components/login/RegisterForm/index.js +0 -171
- package/src/components/login/jwtService.js +0 -201
- package/src/components/login/style.css +0 -158
- package/src/components/login/style.scss +0 -260
- package/src/components/myprojects/export.js +0 -5
- package/src/components/myprojects/index.jsx +0 -445
- package/src/components/myprojects/styles.js +0 -241
- package/src/components/sidebar/custom-accordion.jsx +0 -48
- package/src/components/sidebar/export.js +0 -15
- package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +0 -73
- package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +0 -101
- package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +0 -149
- package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +0 -316
- package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +0 -108
- package/src/components/sidebar/panel-element-editor/element-editor.jsx +0 -1070
- package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
- package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +0 -104
- package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +0 -155
- package/src/components/sidebar/panel-group-editor.jsx +0 -272
- package/src/components/sidebar/panel-groups.jsx +0 -310
- package/src/components/sidebar/panel-guides.jsx +0 -192
- package/src/components/sidebar/panel-layer-elements.jsx +0 -298
- package/src/components/sidebar/panel-layers.jsx +0 -381
- package/src/components/sidebar/panel.jsx +0 -71
- package/src/components/sidebar/sidebar.jsx +0 -106
- package/src/components/sidebar/toolbar-panel.jsx +0 -139
- package/src/components/sign/export.js +0 -7
- package/src/components/sign/main/index.jsx +0 -523
- package/src/components/sign/main/styles.js +0 -163
- package/src/components/toolbar/button/ControlButton.jsx +0 -41
- package/src/components/toolbar/button/DirectionButton.jsx +0 -34
- package/src/components/toolbar/button/RightButton.jsx +0 -103
- package/src/components/toolbar/button/ToggleButton.jsx +0 -41
- package/src/components/toolbar/button/index.jsx +0 -55
- package/src/components/toolbar/button/styles.js +0 -127
- package/src/components/toolbar/components/DoorStyleMenu.jsx +0 -103
- package/src/components/toolbar/components/Pricing.jsx +0 -126
- package/src/components/toolbar/components/ReviewForQuote.jsx +0 -635
- package/src/components/toolbar/export.js +0 -21
- package/src/components/toolbar/main/Alert.js +0 -122
- package/src/components/toolbar/main/TakePictureModal.jsx +0 -104
- package/src/components/toolbar/main/confirm-popup.jsx +0 -99
- package/src/components/toolbar/main/index.jsx +0 -5687
- package/src/components/toolbar/main/lShaped.json +0 -311
- package/src/components/toolbar/main/longNarrow.json +0 -238
- package/src/components/toolbar/main/myComponents.js +0 -123
- package/src/components/toolbar/main/oRectangle.json +0 -220
- package/src/components/toolbar/main/rectangle.json +0 -238
- package/src/components/toolbar/main/style.css +0 -107
- package/src/components/toolbar/main/styles.js +0 -696
- package/src/components/toolbar/plugin-item.jsx +0 -123
- package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +0 -73
- package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +0 -102
- package/src/components/toolbar/popup/appliance/index.jsx +0 -83
- package/src/components/toolbar/popup/autosaveprompt/index.jsx +0 -150
- package/src/components/toolbar/popup/autosaveprompt/styles.css +0 -64
- package/src/components/toolbar/popup/autosaveprompt/styles.js +0 -40
- package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +0 -73
- package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +0 -119
- package/src/components/toolbar/popup/cabinet/index.jsx +0 -85
- package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +0 -63
- package/src/components/toolbar/popup/doorStyle/index.jsx +0 -71
- package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +0 -139
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +0 -2
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +0 -157
- package/src/components/toolbar/popup/downloadsummary/index.jsx +0 -643
- package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +0 -51
- package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +0 -175
- package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +0 -283
- package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +0 -2257
- package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +0 -93
- package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +0 -132
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +0 -2198
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +0 -152
- package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +0 -149
- package/src/components/toolbar/popup/downloadsummary/styles.css +0 -177
- package/src/components/toolbar/popup/downloadsummary/styles.js +0 -453
- package/src/components/toolbar/popup/finishingtouch/category/index.jsx +0 -34
- package/src/components/toolbar/popup/finishingtouch/index.jsx +0 -58
- package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +0 -112
- package/src/components/toolbar/popup/finishingtouch/product/index.jsx +0 -116
- package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +0 -101
- package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +0 -254
- package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +0 -311
- package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +0 -220
- package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +0 -238
- package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +0 -86
- package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +0 -109
- package/src/components/toolbar/popup/floorplan/index.jsx +0 -60
- package/src/components/toolbar/popup/index.jsx +0 -241
- package/src/components/toolbar/popup/newproject/index.jsx +0 -59
- package/src/components/toolbar/popup/newproject/styles.css +0 -64
- package/src/components/toolbar/popup/newproject/styles.js +0 -41
- package/src/components/toolbar/popup/product/appliance.jsx +0 -54
- package/src/components/toolbar/popup/product/cabinetproduct.jsx +0 -15
- package/src/components/toolbar/popup/product/doorstyle.jsx +0 -58
- package/src/components/toolbar/popup/product/doorstyleproduct.jsx +0 -47
- package/src/components/toolbar/popup/product/floor.jsx +0 -36
- package/src/components/toolbar/popup/product/floorproduct.jsx +0 -42
- package/src/components/toolbar/popup/product/index.jsx +0 -36
- package/src/components/toolbar/popup/product/primary.jsx +0 -77
- package/src/components/toolbar/popup/product/productline.jsx +0 -93
- package/src/components/toolbar/popup/product/reviewItem.jsx +0 -427
- package/src/components/toolbar/popup/product/reviewMolding.jsx +0 -310
- package/src/components/toolbar/popup/product/style.css +0 -54
- package/src/components/toolbar/popup/product/styles.js +0 -260
- package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +0 -146
- package/src/components/toolbar/popup/savedesign/index.jsx +0 -495
- package/src/components/toolbar/popup/savedesign/savedesign.style.css +0 -16
- package/src/components/toolbar/popup/savedesign/styles.js +0 -151
- package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +0 -87
- package/src/components/toolbar/popup/styles.js +0 -909
- package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +0 -192
- package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +0 -96
- package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +0 -54
- package/src/components/toolbar/popup/submitforquote/StepDots.jsx +0 -25
- package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +0 -116
- package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +0 -38
- package/src/components/toolbar/popup/submitforquote/index.jsx +0 -698
- package/src/components/toolbar/popup/submitforquote/styles.css +0 -105
- package/src/components/toolbar/popup/submitforquote/styles.js +0 -294
- package/src/components/toolbar/popup/submitprompt/index.jsx +0 -89
- package/src/components/toolbar/popup/submitprompt/styles.css +0 -64
- package/src/components/toolbar/popup/submitprompt/styles.js +0 -42
- package/src/components/toolbar/toolbar-button.jsx +0 -90
- package/src/components/toolbar/toolbar-load-button.jsx +0 -36
- package/src/components/toolbar/toolbar-save-button.jsx +0 -32
- package/src/components/wizardstep/button/styles.js +0 -677
- package/src/components/wizardstep/export.js +0 -5
- package/src/components/wizardstep/index.jsx +0 -1372
- package/src/components/wizardstep/styles.js +0 -688
- package/src/components/wizardstep/wizardstep-content-button.jsx +0 -198
- package/src/components/wizardstep/wizardstep-toggle-button.jsx +0 -101
- package/src/hooks/useCheckCart.js +0 -38
- package/src/hooks/useGetPricesBySku.js +0 -59
- package/src/hooks/useValidateToken.js +0 -181
- package/src/styles/export.js +0 -7
- package/src/styles/tabs.css +0 -40
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Panel from './panel';
|
|
4
|
-
import {
|
|
5
|
-
MODE_IDLE,
|
|
6
|
-
MODE_2D_ZOOM_IN,
|
|
7
|
-
MODE_2D_ZOOM_OUT,
|
|
8
|
-
MODE_2D_PAN,
|
|
9
|
-
MODE_3D_VIEW,
|
|
10
|
-
MODE_3D_FIRST_PERSON,
|
|
11
|
-
MODE_WAITING_DRAWING_LINE,
|
|
12
|
-
MODE_DRAWING_LINE,
|
|
13
|
-
MODE_DRAWING_HOLE,
|
|
14
|
-
MODE_DRAWING_ITEM,
|
|
15
|
-
MODE_DRAGGING_LINE,
|
|
16
|
-
MODE_DRAGGING_VERTEX,
|
|
17
|
-
MODE_DRAGGING_ITEM,
|
|
18
|
-
MODE_DRAGGING_HOLE,
|
|
19
|
-
MODE_FITTING_IMAGE,
|
|
20
|
-
MODE_UPLOADING_IMAGE,
|
|
21
|
-
MODE_ROTATING_ITEM,
|
|
22
|
-
MODE_IDLE_3D,
|
|
23
|
-
MODE_DRAGGING_ITEM_3D,
|
|
24
|
-
MODE_ROTATING_ITEM_3D
|
|
25
|
-
} from '../../constants';
|
|
26
|
-
import * as SharedStyle from '../../shared-style';
|
|
27
|
-
import { MdSearch } from 'react-icons/md';
|
|
28
|
-
|
|
29
|
-
const VISIBILITY_MODE = {
|
|
30
|
-
MODE_IDLE,
|
|
31
|
-
MODE_2D_ZOOM_IN,
|
|
32
|
-
MODE_2D_ZOOM_OUT,
|
|
33
|
-
MODE_2D_PAN,
|
|
34
|
-
MODE_3D_VIEW,
|
|
35
|
-
MODE_3D_FIRST_PERSON,
|
|
36
|
-
MODE_WAITING_DRAWING_LINE,
|
|
37
|
-
MODE_DRAWING_LINE,
|
|
38
|
-
MODE_DRAWING_HOLE,
|
|
39
|
-
MODE_DRAWING_ITEM,
|
|
40
|
-
MODE_DRAGGING_LINE,
|
|
41
|
-
MODE_DRAGGING_VERTEX,
|
|
42
|
-
MODE_DRAGGING_ITEM,
|
|
43
|
-
MODE_DRAGGING_HOLE,
|
|
44
|
-
MODE_FITTING_IMAGE,
|
|
45
|
-
MODE_UPLOADING_IMAGE,
|
|
46
|
-
MODE_ROTATING_ITEM,
|
|
47
|
-
MODE_IDLE_3D,
|
|
48
|
-
MODE_DRAGGING_ITEM_3D,
|
|
49
|
-
MODE_ROTATING_ITEM_3D
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const contentArea = {
|
|
53
|
-
height: 'auto',
|
|
54
|
-
maxHeight: '15em',
|
|
55
|
-
overflowY: 'auto',
|
|
56
|
-
padding: '0.25em 1.15em',
|
|
57
|
-
cursor: 'pointer',
|
|
58
|
-
marginBottom: '1em',
|
|
59
|
-
userSelect: 'none'
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const elementStyle = {
|
|
63
|
-
width: 'auto',
|
|
64
|
-
height: '2.5em',
|
|
65
|
-
margin: '0.25em 0.25em 0 0',
|
|
66
|
-
padding: '0.5em',
|
|
67
|
-
textAlign: 'center',
|
|
68
|
-
display: 'inline-block',
|
|
69
|
-
border: '1px solid #CCC',
|
|
70
|
-
borderRadius: '0.2em'
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const elementSelectedStyle = {
|
|
74
|
-
...elementStyle,
|
|
75
|
-
color: SharedStyle.SECONDARY_COLOR.main,
|
|
76
|
-
borderColor: SharedStyle.SECONDARY_COLOR.main
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const categoryDividerStyle = {
|
|
80
|
-
paddingBottom: '0.5em',
|
|
81
|
-
borderBottom: '1px solid #888'
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const tableSearchStyle = { width: '100%', marginTop: '0.8em' };
|
|
85
|
-
const searchIconStyle = { fontSize: '1.5em' };
|
|
86
|
-
const searchInputStyle = {
|
|
87
|
-
fontSize: '1em',
|
|
88
|
-
width: '100%',
|
|
89
|
-
height: '1em',
|
|
90
|
-
padding: '1em 0.5em'
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export default class PanelLayerElement extends Component {
|
|
94
|
-
constructor(props, context) {
|
|
95
|
-
super(props, context);
|
|
96
|
-
|
|
97
|
-
let layer = props.layers.get(props.selectedLayer);
|
|
98
|
-
let elements = {
|
|
99
|
-
lines: layer.lines,
|
|
100
|
-
holes: layer.holes,
|
|
101
|
-
items: layer.items
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
this.state = {
|
|
105
|
-
elements,
|
|
106
|
-
matchString: '',
|
|
107
|
-
matchedElements: elements
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
112
|
-
if (this.state.matchString !== nextState.matchString) return true;
|
|
113
|
-
|
|
114
|
-
let oldElements = this.state.elements;
|
|
115
|
-
let newElements = nextState.elements;
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
oldElements.lines.hashCode() !== newElements.lines.hashCode() ||
|
|
119
|
-
oldElements.holes.hashCode() !== newElements.holes.hashCode() ||
|
|
120
|
-
oldElements.items.hashCode() !== newElements.items.hashCode()
|
|
121
|
-
)
|
|
122
|
-
return true;
|
|
123
|
-
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
componentWillReceiveProps(nextProps) {
|
|
128
|
-
let layer = nextProps.layers.get(nextProps.selectedLayer);
|
|
129
|
-
|
|
130
|
-
if (this.props.layers.hashCode() === nextProps.layers.hashCode()) return;
|
|
131
|
-
|
|
132
|
-
let elements = {
|
|
133
|
-
lines: layer.lines,
|
|
134
|
-
holes: layer.holes,
|
|
135
|
-
items: layer.items
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
if (this.state.matchString !== '') {
|
|
139
|
-
let regexp = new RegExp(this.state.matchString, 'i');
|
|
140
|
-
let filterCb = el => regexp.test(el.get('name'));
|
|
141
|
-
|
|
142
|
-
this.setState({
|
|
143
|
-
matchedElements: {
|
|
144
|
-
elements,
|
|
145
|
-
lines: elements.lines.filter(filterCb),
|
|
146
|
-
holes: elements.holes.filter(filterCb),
|
|
147
|
-
items: elements.items.filter(filterCb)
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
} else {
|
|
151
|
-
this.setState({ elements, matchedElements: elements });
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
matcharray(text) {
|
|
156
|
-
if (text === '') {
|
|
157
|
-
this.setState({
|
|
158
|
-
matchString: '',
|
|
159
|
-
matchedElements: this.state.elements
|
|
160
|
-
});
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
let regexp = new RegExp(text, 'i');
|
|
165
|
-
let filterCb = el => regexp.test(el.get('name'));
|
|
166
|
-
|
|
167
|
-
this.setState({
|
|
168
|
-
matchString: text,
|
|
169
|
-
matchedElements: {
|
|
170
|
-
lines: this.state.elements.lines.filter(filterCb),
|
|
171
|
-
holes: this.state.elements.holes.filter(filterCb),
|
|
172
|
-
items: this.state.elements.items.filter(filterCb)
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
render() {
|
|
178
|
-
if (!VISIBILITY_MODE[this.props.mode]) return null;
|
|
179
|
-
|
|
180
|
-
let layer = this.props.layers.get(this.props.selectedLayer);
|
|
181
|
-
|
|
182
|
-
return (
|
|
183
|
-
<Panel
|
|
184
|
-
name={this.context.translator.t('Elements on layer {0}', layer.name)}
|
|
185
|
-
>
|
|
186
|
-
<div style={contentArea} onWheel={e => e.stopPropagation()}>
|
|
187
|
-
<table style={tableSearchStyle}>
|
|
188
|
-
<tbody>
|
|
189
|
-
<tr>
|
|
190
|
-
<td>
|
|
191
|
-
<MdSearch style={searchIconStyle} />
|
|
192
|
-
</td>
|
|
193
|
-
<td>
|
|
194
|
-
<input
|
|
195
|
-
type="text"
|
|
196
|
-
style={searchInputStyle}
|
|
197
|
-
onChange={e => {
|
|
198
|
-
this.matcharray(e.target.value);
|
|
199
|
-
}}
|
|
200
|
-
/>
|
|
201
|
-
</td>
|
|
202
|
-
</tr>
|
|
203
|
-
</tbody>
|
|
204
|
-
</table>
|
|
205
|
-
|
|
206
|
-
{this.state.matchedElements.lines.count() ? (
|
|
207
|
-
<div>
|
|
208
|
-
<p style={categoryDividerStyle}>
|
|
209
|
-
{this.context.translator.t('Lines')}
|
|
210
|
-
</p>
|
|
211
|
-
{this.state.matchedElements.lines
|
|
212
|
-
.entrySeq()
|
|
213
|
-
.map(([lineID, line]) => {
|
|
214
|
-
return (
|
|
215
|
-
<div
|
|
216
|
-
key={lineID}
|
|
217
|
-
onClick={e =>
|
|
218
|
-
this.context.linesActions.selectLine(layer.id, line.id)
|
|
219
|
-
}
|
|
220
|
-
style={
|
|
221
|
-
line.selected ? elementSelectedStyle : elementStyle
|
|
222
|
-
}
|
|
223
|
-
>
|
|
224
|
-
{line.name}
|
|
225
|
-
</div>
|
|
226
|
-
);
|
|
227
|
-
})}
|
|
228
|
-
</div>
|
|
229
|
-
) : null}
|
|
230
|
-
|
|
231
|
-
{this.state.matchedElements.holes.count() ? (
|
|
232
|
-
<div>
|
|
233
|
-
<p style={categoryDividerStyle}>
|
|
234
|
-
{this.context.translator.t('Holes')}
|
|
235
|
-
</p>
|
|
236
|
-
{this.state.matchedElements.holes
|
|
237
|
-
.entrySeq()
|
|
238
|
-
.map(([holeID, hole]) => {
|
|
239
|
-
return (
|
|
240
|
-
<div
|
|
241
|
-
key={holeID}
|
|
242
|
-
onClick={e =>
|
|
243
|
-
this.context.holesActions.selectHole(layer.id, hole.id)
|
|
244
|
-
}
|
|
245
|
-
style={
|
|
246
|
-
hole.selected ? elementSelectedStyle : elementStyle
|
|
247
|
-
}
|
|
248
|
-
>
|
|
249
|
-
{hole.name}
|
|
250
|
-
</div>
|
|
251
|
-
);
|
|
252
|
-
})}
|
|
253
|
-
</div>
|
|
254
|
-
) : null}
|
|
255
|
-
|
|
256
|
-
{this.state.matchedElements.items.count() ? (
|
|
257
|
-
<div>
|
|
258
|
-
<p style={categoryDividerStyle}>
|
|
259
|
-
{this.context.translator.t('Items')}
|
|
260
|
-
</p>
|
|
261
|
-
{this.state.matchedElements.items
|
|
262
|
-
.entrySeq()
|
|
263
|
-
.map(([itemID, item]) => {
|
|
264
|
-
return (
|
|
265
|
-
<div
|
|
266
|
-
key={itemID}
|
|
267
|
-
onClick={e =>
|
|
268
|
-
this.context.itemsActions.selectItem(layer.id, item.id)
|
|
269
|
-
}
|
|
270
|
-
style={
|
|
271
|
-
item.selected ? elementSelectedStyle : elementStyle
|
|
272
|
-
}
|
|
273
|
-
>
|
|
274
|
-
{item.name}
|
|
275
|
-
</div>
|
|
276
|
-
);
|
|
277
|
-
})}
|
|
278
|
-
</div>
|
|
279
|
-
) : null}
|
|
280
|
-
</div>
|
|
281
|
-
</Panel>
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
PanelLayerElement.propTypes = {
|
|
287
|
-
mode: PropTypes.string.isRequired,
|
|
288
|
-
layers: PropTypes.object.isRequired
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
PanelLayerElement.contextTypes = {
|
|
292
|
-
catalog: PropTypes.object.isRequired,
|
|
293
|
-
translator: PropTypes.object.isRequired,
|
|
294
|
-
itemsActions: PropTypes.object.isRequired,
|
|
295
|
-
linesActions: PropTypes.object.isRequired,
|
|
296
|
-
holesActions: PropTypes.object.isRequired,
|
|
297
|
-
projectActions: PropTypes.object.isRequired
|
|
298
|
-
};
|
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Map } from 'immutable';
|
|
4
|
-
import Panel from './panel';
|
|
5
|
-
import { TiPlus, TiDelete } from 'react-icons/ti';
|
|
6
|
-
import { FaPencilAlt, FaTrash, FaEye } from 'react-icons/fa';
|
|
7
|
-
import {
|
|
8
|
-
FormTextInput,
|
|
9
|
-
FormNumberInput,
|
|
10
|
-
FormSubmitButton,
|
|
11
|
-
FormSlider,
|
|
12
|
-
CancelButton
|
|
13
|
-
} from '../style/export';
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
MODE_IDLE,
|
|
17
|
-
MODE_2D_ZOOM_IN,
|
|
18
|
-
MODE_2D_ZOOM_OUT,
|
|
19
|
-
MODE_2D_PAN,
|
|
20
|
-
MODE_3D_VIEW,
|
|
21
|
-
MODE_3D_FIRST_PERSON,
|
|
22
|
-
MODE_WAITING_DRAWING_LINE,
|
|
23
|
-
MODE_DRAWING_LINE,
|
|
24
|
-
MODE_DRAWING_HOLE,
|
|
25
|
-
MODE_DRAWING_ITEM,
|
|
26
|
-
MODE_DRAGGING_LINE,
|
|
27
|
-
MODE_DRAGGING_VERTEX,
|
|
28
|
-
MODE_DRAGGING_ITEM,
|
|
29
|
-
MODE_DRAGGING_HOLE,
|
|
30
|
-
MODE_FITTING_IMAGE,
|
|
31
|
-
MODE_UPLOADING_IMAGE,
|
|
32
|
-
MODE_ROTATING_ITEM,
|
|
33
|
-
MODE_IDLE_3D,
|
|
34
|
-
MODE_DRAGGING_ITEM_3D,
|
|
35
|
-
MODE_ROTATING_ITEM_3D
|
|
36
|
-
} from '../../constants';
|
|
37
|
-
import * as SharedStyle from '../../shared-style';
|
|
38
|
-
|
|
39
|
-
const VISIBILITY_MODE = {
|
|
40
|
-
MODE_IDLE,
|
|
41
|
-
MODE_2D_ZOOM_IN,
|
|
42
|
-
MODE_2D_ZOOM_OUT,
|
|
43
|
-
MODE_2D_PAN,
|
|
44
|
-
MODE_3D_VIEW,
|
|
45
|
-
MODE_3D_FIRST_PERSON,
|
|
46
|
-
MODE_WAITING_DRAWING_LINE,
|
|
47
|
-
MODE_DRAWING_LINE,
|
|
48
|
-
MODE_DRAWING_HOLE,
|
|
49
|
-
MODE_DRAWING_ITEM,
|
|
50
|
-
MODE_DRAGGING_LINE,
|
|
51
|
-
MODE_DRAGGING_VERTEX,
|
|
52
|
-
MODE_DRAGGING_ITEM,
|
|
53
|
-
MODE_DRAGGING_HOLE,
|
|
54
|
-
MODE_ROTATING_ITEM,
|
|
55
|
-
MODE_UPLOADING_IMAGE,
|
|
56
|
-
MODE_FITTING_IMAGE,
|
|
57
|
-
MODE_IDLE_3D,
|
|
58
|
-
MODE_DRAGGING_ITEM_3D,
|
|
59
|
-
MODE_ROTATING_ITEM_3D
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const styleEditButton = {
|
|
63
|
-
cursor: 'pointer',
|
|
64
|
-
marginLeft: '5px',
|
|
65
|
-
border: '0px',
|
|
66
|
-
background: 'none',
|
|
67
|
-
color: SharedStyle.COLORS.white,
|
|
68
|
-
fontSize: '14px',
|
|
69
|
-
outline: '0px'
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const tableLayerStyle = {
|
|
73
|
-
width: '100%',
|
|
74
|
-
cursor: 'pointer',
|
|
75
|
-
overflowY: 'auto',
|
|
76
|
-
maxHeight: '20em',
|
|
77
|
-
display: 'block',
|
|
78
|
-
padding: '0 1em',
|
|
79
|
-
marginLeft: '1px'
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const iconColStyle = { width: '2em' };
|
|
83
|
-
const styleHoverColor = { color: SharedStyle.SECONDARY_COLOR.main };
|
|
84
|
-
const styleEditButtonHover = { ...styleEditButton, ...styleHoverColor };
|
|
85
|
-
const styleAddLabel = { fontSize: '10px', marginLeft: '5px' };
|
|
86
|
-
const styleEyeVisible = { fontSize: '1.25em' };
|
|
87
|
-
const styleEyeHidden = { ...styleEyeVisible, color: '#a5a1a1' };
|
|
88
|
-
const firstTdStyle = { width: '6em' };
|
|
89
|
-
const newLayerLableStyle = {
|
|
90
|
-
margin: '0.5em 0',
|
|
91
|
-
fontSize: '1.3em',
|
|
92
|
-
cursor: 'pointer',
|
|
93
|
-
textAlign: 'center'
|
|
94
|
-
};
|
|
95
|
-
const newLayerLableHoverStyle = { ...newLayerLableStyle, ...styleHoverColor };
|
|
96
|
-
const layerInputTableStyle = {
|
|
97
|
-
width: '100%',
|
|
98
|
-
borderSpacing: '2px 0',
|
|
99
|
-
padding: '5px 15px'
|
|
100
|
-
};
|
|
101
|
-
const inputTableButtonStyle = {
|
|
102
|
-
float: 'right',
|
|
103
|
-
marginTop: '0.5em',
|
|
104
|
-
borderSpacing: '0'
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export default class PanelLayers extends Component {
|
|
108
|
-
constructor(props) {
|
|
109
|
-
super(props);
|
|
110
|
-
|
|
111
|
-
this.state = {
|
|
112
|
-
headHovered: false,
|
|
113
|
-
layerAddUIVisible: false,
|
|
114
|
-
editingLayer: new Map()
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
119
|
-
if (
|
|
120
|
-
this.props.state.scene.layers.size !==
|
|
121
|
-
nextProps.state.scene.layers.size ||
|
|
122
|
-
nextState.layerAddUIVisible != this.state.layerAddUIVisible ||
|
|
123
|
-
this.state.editingLayer.hashCode() !==
|
|
124
|
-
nextState.editingLayer.hashCode() ||
|
|
125
|
-
this.props.state.sceneHistory.hashCode() !==
|
|
126
|
-
nextProps.state.sceneHistory.hashCode()
|
|
127
|
-
)
|
|
128
|
-
return true;
|
|
129
|
-
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
addLayer(e) {
|
|
134
|
-
e.stopPropagation();
|
|
135
|
-
if (!this.state.layerAddUIVisible) {
|
|
136
|
-
this.context.sceneActions.addLayer('', 0);
|
|
137
|
-
this.setState({ layerAddUIVisible: false });
|
|
138
|
-
} else this.setState({ layerAddUIVisible: !this.state.layerAddUIVisible });
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
resetLayerMod(e) {
|
|
142
|
-
e.stopPropagation();
|
|
143
|
-
this.setState({ layerAddUIVisible: false, editingLayer: new Map() });
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
updateLayer(e, layerData) {
|
|
147
|
-
e.stopPropagation();
|
|
148
|
-
let { id, name, opacity, altitude, order } = layerData.toJS();
|
|
149
|
-
|
|
150
|
-
altitude = parseInt(altitude);
|
|
151
|
-
|
|
152
|
-
this.context.sceneActions.setLayerProperties(id, {
|
|
153
|
-
name,
|
|
154
|
-
opacity,
|
|
155
|
-
altitude,
|
|
156
|
-
order
|
|
157
|
-
});
|
|
158
|
-
this.setState({ layerAddUIVisible: false, editingLayer: new Map() });
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
delLayer(e, layerID) {
|
|
162
|
-
e.stopPropagation();
|
|
163
|
-
this.context.sceneActions.removeLayer(layerID);
|
|
164
|
-
this.setState({ layerAddUIVisible: false, editingLayer: new Map() });
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
render() {
|
|
168
|
-
if (!VISIBILITY_MODE[this.props.state.mode]) return null;
|
|
169
|
-
|
|
170
|
-
let scene = this.props.state.scene;
|
|
171
|
-
let isLastLayer = scene.layers.size === 1;
|
|
172
|
-
|
|
173
|
-
return (
|
|
174
|
-
<Panel name={this.context.translator.t('Layers')}>
|
|
175
|
-
<table style={tableLayerStyle}>
|
|
176
|
-
<thead>
|
|
177
|
-
<tr>
|
|
178
|
-
<th colSpan="3"></th>
|
|
179
|
-
<th>{this.context.translator.t('Altitude')}</th>
|
|
180
|
-
<th>{this.context.translator.t('Name')}</th>
|
|
181
|
-
</tr>
|
|
182
|
-
</thead>
|
|
183
|
-
<tbody>
|
|
184
|
-
{scene.layers.entrySeq().map(([layerID, layer]) => {
|
|
185
|
-
let selectClick = e =>
|
|
186
|
-
this.context.sceneActions.selectLayer(layerID);
|
|
187
|
-
let configureClick = e =>
|
|
188
|
-
this.setState({ editingLayer: layer, layerAddUIVisible: true });
|
|
189
|
-
|
|
190
|
-
let swapVisibility = e => {
|
|
191
|
-
e.stopPropagation();
|
|
192
|
-
this.context.sceneActions.setLayerProperties(layerID, {
|
|
193
|
-
visible: !layer.visible
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
let isCurrentLayer = layerID === scene.selectedLayer;
|
|
198
|
-
|
|
199
|
-
return (
|
|
200
|
-
<tr
|
|
201
|
-
key={layerID}
|
|
202
|
-
onClick={selectClick}
|
|
203
|
-
onDoubleClick={configureClick}
|
|
204
|
-
style={!isCurrentLayer ? null : styleHoverColor}
|
|
205
|
-
>
|
|
206
|
-
<td style={iconColStyle}>
|
|
207
|
-
{!isCurrentLayer ? (
|
|
208
|
-
<FaEye
|
|
209
|
-
onClick={swapVisibility}
|
|
210
|
-
style={
|
|
211
|
-
!layer.visible ? styleEyeHidden : styleEyeVisible
|
|
212
|
-
}
|
|
213
|
-
/>
|
|
214
|
-
) : null}
|
|
215
|
-
</td>
|
|
216
|
-
<td style={iconColStyle}>
|
|
217
|
-
<FaPencilAlt
|
|
218
|
-
onClick={configureClick}
|
|
219
|
-
style={
|
|
220
|
-
!isCurrentLayer ? styleEditButton : styleEditButtonHover
|
|
221
|
-
}
|
|
222
|
-
title={this.context.translator.t('Configure layer')}
|
|
223
|
-
/>
|
|
224
|
-
</td>
|
|
225
|
-
<td style={iconColStyle}>
|
|
226
|
-
{!isLastLayer ? (
|
|
227
|
-
<FaTrash
|
|
228
|
-
onClick={e => this.delLayer(e, layerID)}
|
|
229
|
-
style={
|
|
230
|
-
!isCurrentLayer
|
|
231
|
-
? styleEditButton
|
|
232
|
-
: styleEditButtonHover
|
|
233
|
-
}
|
|
234
|
-
title={this.context.translator.t('Delete layer')}
|
|
235
|
-
/>
|
|
236
|
-
) : null}
|
|
237
|
-
</td>
|
|
238
|
-
<td style={{ width: '6em', textAlign: 'center' }}>
|
|
239
|
-
[ h : {layer.altitude} ]
|
|
240
|
-
</td>
|
|
241
|
-
<td>{layer.name}</td>
|
|
242
|
-
</tr>
|
|
243
|
-
);
|
|
244
|
-
})}
|
|
245
|
-
</tbody>
|
|
246
|
-
</table>
|
|
247
|
-
<p
|
|
248
|
-
style={
|
|
249
|
-
!this.state.headHovered
|
|
250
|
-
? newLayerLableStyle
|
|
251
|
-
: newLayerLableHoverStyle
|
|
252
|
-
}
|
|
253
|
-
onMouseOver={() => this.setState({ headHovered: true })}
|
|
254
|
-
onMouseOut={() => this.setState({ headHovered: false })}
|
|
255
|
-
onClick={e => this.addLayer(e)}
|
|
256
|
-
>
|
|
257
|
-
{!this.state.layerAddUIVisible ? <TiPlus /> : <TiDelete />}
|
|
258
|
-
<b style={styleAddLabel}>{this.context.translator.t('New layer')}</b>
|
|
259
|
-
</p>
|
|
260
|
-
|
|
261
|
-
{this.state.layerAddUIVisible && this.state.editingLayer ? (
|
|
262
|
-
<table style={layerInputTableStyle}>
|
|
263
|
-
<tbody>
|
|
264
|
-
<tr style={{ marginTop: '1em' }}>
|
|
265
|
-
<td style={firstTdStyle}>
|
|
266
|
-
{this.context.translator.t('Name')}:
|
|
267
|
-
</td>
|
|
268
|
-
<td>
|
|
269
|
-
<FormTextInput
|
|
270
|
-
value={this.state.editingLayer.get('name')}
|
|
271
|
-
onChange={e =>
|
|
272
|
-
this.setState({
|
|
273
|
-
editingLayer: this.state.editingLayer.merge({
|
|
274
|
-
name: e.target.value
|
|
275
|
-
})
|
|
276
|
-
})
|
|
277
|
-
}
|
|
278
|
-
/>
|
|
279
|
-
</td>
|
|
280
|
-
</tr>
|
|
281
|
-
<tr>
|
|
282
|
-
<td style={firstTdStyle}>
|
|
283
|
-
{this.context.translator.t('opacity')}:
|
|
284
|
-
</td>
|
|
285
|
-
<td>
|
|
286
|
-
<FormSlider
|
|
287
|
-
min={0}
|
|
288
|
-
max={100}
|
|
289
|
-
value={Math.round(
|
|
290
|
-
this.state.editingLayer.get('opacity') * 100
|
|
291
|
-
)}
|
|
292
|
-
onChange={e =>
|
|
293
|
-
this.setState({
|
|
294
|
-
editingLayer: this.state.editingLayer.merge({
|
|
295
|
-
opacity: e.target.value / 100
|
|
296
|
-
})
|
|
297
|
-
})
|
|
298
|
-
}
|
|
299
|
-
/>
|
|
300
|
-
</td>
|
|
301
|
-
</tr>
|
|
302
|
-
<tr>
|
|
303
|
-
<td style={firstTdStyle}>
|
|
304
|
-
{this.context.translator.t('altitude')}:
|
|
305
|
-
</td>
|
|
306
|
-
<td>
|
|
307
|
-
<FormNumberInput
|
|
308
|
-
value={this.state.editingLayer.get('altitude')}
|
|
309
|
-
onChange={e =>
|
|
310
|
-
this.setState({
|
|
311
|
-
editingLayer: this.state.editingLayer.merge({
|
|
312
|
-
altitude: e.target.value
|
|
313
|
-
})
|
|
314
|
-
})
|
|
315
|
-
}
|
|
316
|
-
/>
|
|
317
|
-
</td>
|
|
318
|
-
</tr>
|
|
319
|
-
<tr>
|
|
320
|
-
<td style={firstTdStyle}>
|
|
321
|
-
{this.context.translator.t('order')}:
|
|
322
|
-
</td>
|
|
323
|
-
<td>
|
|
324
|
-
<FormNumberInput
|
|
325
|
-
value={this.state.editingLayer.get('order')}
|
|
326
|
-
onChange={e =>
|
|
327
|
-
this.setState({
|
|
328
|
-
editingLayer: this.state.editingLayer.merge({
|
|
329
|
-
order: e.target.value
|
|
330
|
-
})
|
|
331
|
-
})
|
|
332
|
-
}
|
|
333
|
-
/>
|
|
334
|
-
</td>
|
|
335
|
-
</tr>
|
|
336
|
-
<tr>
|
|
337
|
-
<td colSpan="2">
|
|
338
|
-
<table style={inputTableButtonStyle}>
|
|
339
|
-
<tbody>
|
|
340
|
-
<tr>
|
|
341
|
-
<td>
|
|
342
|
-
<CancelButton
|
|
343
|
-
size="small"
|
|
344
|
-
onClick={e => {
|
|
345
|
-
this.resetLayerMod(e);
|
|
346
|
-
}}
|
|
347
|
-
>
|
|
348
|
-
{this.context.translator.t('Reset')}
|
|
349
|
-
</CancelButton>
|
|
350
|
-
</td>
|
|
351
|
-
<td>
|
|
352
|
-
<FormSubmitButton
|
|
353
|
-
size="small"
|
|
354
|
-
onClick={e => {
|
|
355
|
-
this.updateLayer(e, this.state.editingLayer);
|
|
356
|
-
}}
|
|
357
|
-
>
|
|
358
|
-
{this.context.translator.t('Save')}
|
|
359
|
-
</FormSubmitButton>
|
|
360
|
-
</td>
|
|
361
|
-
</tr>
|
|
362
|
-
</tbody>
|
|
363
|
-
</table>
|
|
364
|
-
</td>
|
|
365
|
-
</tr>
|
|
366
|
-
</tbody>
|
|
367
|
-
</table>
|
|
368
|
-
) : null}
|
|
369
|
-
</Panel>
|
|
370
|
-
);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
PanelLayers.propTypes = {
|
|
375
|
-
state: PropTypes.object.isRequired
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
PanelLayers.contextTypes = {
|
|
379
|
-
sceneActions: PropTypes.object.isRequired,
|
|
380
|
-
translator: PropTypes.object.isRequired
|
|
381
|
-
};
|