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,198 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as SharedStyle from '../../shared-style';
|
|
4
|
-
import { FaTimes as IconClose } from 'react-icons/fa';
|
|
5
|
-
|
|
6
|
-
const labelContainerStyle = {
|
|
7
|
-
width: 'auto',
|
|
8
|
-
display: 'inline-block',
|
|
9
|
-
margin: 0,
|
|
10
|
-
padding: '0px 5px 0px 0px'
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const toggleButtonStyle = {
|
|
14
|
-
color: '#CCC',
|
|
15
|
-
textAlign: 'center',
|
|
16
|
-
cursor: 'pointer',
|
|
17
|
-
userSelect: 'none'
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const toggleButtonStyleOver = {
|
|
21
|
-
...toggleButtonStyle,
|
|
22
|
-
color: SharedStyle.COLORS.white
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const contentContainerStyleActive = {
|
|
26
|
-
position: 'fixed',
|
|
27
|
-
width: 'calc( 100% - 2px )',
|
|
28
|
-
height: '40%',
|
|
29
|
-
left: 0,
|
|
30
|
-
bottom: 20,
|
|
31
|
-
backgroundColor: SharedStyle.PRIMARY_COLOR.alt,
|
|
32
|
-
borderTop: SharedStyle.PRIMARY_COLOR.border,
|
|
33
|
-
zIndex: 0,
|
|
34
|
-
padding: 0,
|
|
35
|
-
margin: 0,
|
|
36
|
-
transition: 'all 300ms ease'
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const contentContainerStyleInactive = {
|
|
40
|
-
...contentContainerStyleActive,
|
|
41
|
-
visibility: 'hidden',
|
|
42
|
-
height: 0
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const contentHeaderStyle = {
|
|
46
|
-
position: 'relative',
|
|
47
|
-
width: '100%',
|
|
48
|
-
height: '2em',
|
|
49
|
-
top: 0,
|
|
50
|
-
left: 0,
|
|
51
|
-
borderBottom: SharedStyle.PRIMARY_COLOR.border
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const titleStyle = {
|
|
55
|
-
position: 'relative',
|
|
56
|
-
height: '2em',
|
|
57
|
-
lineHeight: '2em',
|
|
58
|
-
marginLeft: '1em'
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const contentAreaStyle = {
|
|
62
|
-
position: 'relative',
|
|
63
|
-
width: '100%',
|
|
64
|
-
height: 'calc( 100% - 2em )',
|
|
65
|
-
padding: '1em',
|
|
66
|
-
overflowY: 'auto'
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const iconCloseStyleOut = {
|
|
70
|
-
position: 'absolute',
|
|
71
|
-
width: '2em',
|
|
72
|
-
height: '2em',
|
|
73
|
-
right: 0,
|
|
74
|
-
top: 0,
|
|
75
|
-
padding: '0.5em',
|
|
76
|
-
borderLeft: SharedStyle.PRIMARY_COLOR.border,
|
|
77
|
-
cursor: 'pointer'
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const iconCloseStyleOver = {
|
|
81
|
-
...iconCloseStyleOut,
|
|
82
|
-
color: SharedStyle.COLORS.white,
|
|
83
|
-
backgroundColor: SharedStyle.SECONDARY_COLOR.alt
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const iconStyle = {
|
|
87
|
-
width: '15px',
|
|
88
|
-
height: '15px',
|
|
89
|
-
marginTop: '-2px',
|
|
90
|
-
marginRight: '2px'
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const textStyle = {
|
|
94
|
-
position: 'relative'
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export default class FooterContentButton extends Component {
|
|
98
|
-
constructor(props) {
|
|
99
|
-
super(props);
|
|
100
|
-
|
|
101
|
-
this.state = {
|
|
102
|
-
over: false,
|
|
103
|
-
closeOver: false,
|
|
104
|
-
active: this.props.toggleState || false
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
toggleOver(e) {
|
|
109
|
-
this.setState({ over: true });
|
|
110
|
-
}
|
|
111
|
-
toggleOut(e) {
|
|
112
|
-
this.setState({ over: false });
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
toggle(e) {
|
|
116
|
-
let isActive = !this.state.active;
|
|
117
|
-
this.setState({ active: isActive });
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
121
|
-
if (this.state.over != nextState.over) return true;
|
|
122
|
-
if (this.state.closeOver != nextState.closeOver) return true;
|
|
123
|
-
if (this.state.active != nextState.active) return true;
|
|
124
|
-
|
|
125
|
-
if (this.props.content.length != nextProps.content.length) return true;
|
|
126
|
-
if (this.props.toggleState != nextProps.toggleState) return true;
|
|
127
|
-
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
componentWillReceiveProps(nextProps) {
|
|
132
|
-
if (nextProps.toggleState != this.props.toggleState)
|
|
133
|
-
this.state.active = nextProps.toggleState;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
render() {
|
|
137
|
-
let s = this.state;
|
|
138
|
-
let p = this.props;
|
|
139
|
-
|
|
140
|
-
let LabelIcon = p.icon || null;
|
|
141
|
-
let labelIconStyle = p.iconStyle || {};
|
|
142
|
-
let labelTextStyle = p.textStyle || {};
|
|
143
|
-
let inputTitleStyle = p.titleStyle || {};
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<div style={labelContainerStyle}>
|
|
147
|
-
<div
|
|
148
|
-
style={s.over || s.active ? toggleButtonStyleOver : toggleButtonStyle}
|
|
149
|
-
onClick={e => this.toggle(e)}
|
|
150
|
-
title={p.title}
|
|
151
|
-
>
|
|
152
|
-
<LabelIcon style={{ ...labelIconStyle, ...iconStyle }} />
|
|
153
|
-
<span style={{ ...textStyle, ...labelTextStyle }}>{p.text}</span>
|
|
154
|
-
</div>
|
|
155
|
-
<div
|
|
156
|
-
style={
|
|
157
|
-
s.active
|
|
158
|
-
? contentContainerStyleActive
|
|
159
|
-
: contentContainerStyleInactive
|
|
160
|
-
}
|
|
161
|
-
>
|
|
162
|
-
<div style={contentHeaderStyle}>
|
|
163
|
-
<b style={{ ...titleStyle, ...inputTitleStyle }}>{p.title}</b>
|
|
164
|
-
<IconClose
|
|
165
|
-
style={s.closeOver ? iconCloseStyleOver : iconCloseStyleOut}
|
|
166
|
-
onMouseOver={e => this.setState({ closeOver: true })}
|
|
167
|
-
onMouseOut={e => this.setState({ closeOver: false })}
|
|
168
|
-
onClick={e => this.toggle(e)}
|
|
169
|
-
/>
|
|
170
|
-
</div>
|
|
171
|
-
<div style={contentAreaStyle}>{p.content}</div>
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
FooterContentButton.propTypes = {
|
|
179
|
-
state: PropTypes.object.isRequired,
|
|
180
|
-
text: PropTypes.string.isRequired,
|
|
181
|
-
textStyle: PropTypes.object,
|
|
182
|
-
icon: PropTypes.func,
|
|
183
|
-
iconStyle: PropTypes.object,
|
|
184
|
-
content: PropTypes.array.isRequired,
|
|
185
|
-
toggleState: PropTypes.bool,
|
|
186
|
-
title: PropTypes.string,
|
|
187
|
-
titleStyle: PropTypes.object
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
FooterContentButton.contextTypes = {
|
|
191
|
-
projectActions: PropTypes.object.isRequired,
|
|
192
|
-
viewer2DActions: PropTypes.object.isRequired,
|
|
193
|
-
viewer3DActions: PropTypes.object.isRequired,
|
|
194
|
-
linesActions: PropTypes.object.isRequired,
|
|
195
|
-
holesActions: PropTypes.object.isRequired,
|
|
196
|
-
itemsActions: PropTypes.object.isRequired,
|
|
197
|
-
translator: PropTypes.object.isRequired
|
|
198
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as SharedStyle from '../../shared-style';
|
|
4
|
-
|
|
5
|
-
const toggleButtonStyle = {
|
|
6
|
-
width: '5.5em',
|
|
7
|
-
color: '#CCC',
|
|
8
|
-
textAlign: 'center',
|
|
9
|
-
cursor: 'pointer',
|
|
10
|
-
userSelect: 'none',
|
|
11
|
-
border: '1px solid transparent',
|
|
12
|
-
margin: '-1px 5px 0 5px',
|
|
13
|
-
borderRadius: '2px',
|
|
14
|
-
display: 'inline-block'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const toggleButtonStyleOver = {
|
|
18
|
-
...toggleButtonStyle,
|
|
19
|
-
backgroundColor: '#1c82c6',
|
|
20
|
-
border: '1px solid #FFF',
|
|
21
|
-
color: SharedStyle.COLORS.white
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default class FooterToggleButton extends Component {
|
|
25
|
-
constructor(props) {
|
|
26
|
-
super(props);
|
|
27
|
-
|
|
28
|
-
this.state = {
|
|
29
|
-
over: false,
|
|
30
|
-
active: this.props.toggleState || false
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
toggleOver(e) {
|
|
35
|
-
this.setState({ over: true });
|
|
36
|
-
}
|
|
37
|
-
toggleOut(e) {
|
|
38
|
-
this.setState({ over: false });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
toggle(e) {
|
|
42
|
-
let isActive = !this.state.active;
|
|
43
|
-
this.setState({ active: isActive });
|
|
44
|
-
|
|
45
|
-
if (isActive) {
|
|
46
|
-
this.props.toggleOn();
|
|
47
|
-
} else {
|
|
48
|
-
this.props.toggleOff();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
53
|
-
if (this.state.over != nextState.over) return true;
|
|
54
|
-
if (this.state.active != nextState.active) return true;
|
|
55
|
-
if (this.props.toggleState != nextProps.toggleState) return true;
|
|
56
|
-
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
componentWillReceiveProps(nextProps) {
|
|
61
|
-
if (nextProps.toggleState != this.props.toggleState)
|
|
62
|
-
this.state.active = nextProps.toggleState;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
render() {
|
|
66
|
-
return (
|
|
67
|
-
<div
|
|
68
|
-
style={
|
|
69
|
-
this.state.over || this.state.active
|
|
70
|
-
? toggleButtonStyleOver
|
|
71
|
-
: toggleButtonStyle
|
|
72
|
-
}
|
|
73
|
-
onMouseOver={e => this.toggleOver(e)}
|
|
74
|
-
onMouseOut={e => this.toggleOut(e)}
|
|
75
|
-
onClick={e => this.toggle(e)}
|
|
76
|
-
title={this.props.title}
|
|
77
|
-
>
|
|
78
|
-
{this.props.text}
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
FooterToggleButton.propTypes = {
|
|
85
|
-
state: PropTypes.object.isRequired,
|
|
86
|
-
toggleOn: PropTypes.func.isRequired,
|
|
87
|
-
toggleOff: PropTypes.func.isRequired,
|
|
88
|
-
text: PropTypes.string.isRequired,
|
|
89
|
-
toggleState: PropTypes.bool,
|
|
90
|
-
title: PropTypes.string
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
FooterToggleButton.contextTypes = {
|
|
94
|
-
projectActions: PropTypes.object.isRequired,
|
|
95
|
-
viewer2DActions: PropTypes.object.isRequired,
|
|
96
|
-
viewer3DActions: PropTypes.object.isRequired,
|
|
97
|
-
linesActions: PropTypes.object.isRequired,
|
|
98
|
-
holesActions: PropTypes.object.isRequired,
|
|
99
|
-
itemsActions: PropTypes.object.isRequired,
|
|
100
|
-
translator: PropTypes.object.isRequired
|
|
101
|
-
};
|