kitchen-simulator 5.0.0-test.15 → 5.0.0-test.17
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 +3 -11
- package/src/KitchenConfiguratorApp.jsx +1 -1
- package/src/_KitchenConfigurator.jsx +2 -46
- package/src/_index.js +2 -2
- package/src/actions/_export.js +35 -0
- package/src/components/atoms/Snackbar/index.jsx +0 -43
- package/src/components/atoms/radio-button/index.jsx +0 -20
- package/src/components/atoms/radio-button/styles.js +0 -56
- package/src/components/button/MainButton.jsx +0 -157
- package/src/components/button/ToggleMeasureButton.jsx +0 -65
- package/src/components/content.jsx +0 -136
- package/src/components/molecules/slider/index.jsx +0 -15
- package/src/components/molecules/slider/styles.js +0 -0
- package/src/components/molecules/slider/styles.scss +0 -3
- package/src/components/style/button.jsx +0 -95
- package/src/components/style/cancel-button.jsx +0 -20
- package/src/components/style/content-container.jsx +0 -29
- package/src/components/style/content-title.jsx +0 -20
- package/src/components/style/delete-button.jsx +0 -23
- package/src/components/style/export.jsx +0 -48
- package/src/components/style/form-block.jsx +0 -13
- package/src/components/style/form-color-input.jsx +0 -27
- package/src/components/style/form-label.jsx +0 -15
- package/src/components/style/form-number-input.jsx +0 -196
- package/src/components/style/form-number-input_2.jsx +0 -191
- package/src/components/style/form-select.jsx +0 -38
- package/src/components/style/form-slider.jsx +0 -36
- package/src/components/style/form-submit-button.jsx +0 -23
- package/src/components/style/form-text-input.jsx +0 -65
- package/src/components/tutorial-view/Modal.jsx +0 -584
- package/src/components/tutorial-view/style.css +0 -111
- package/src/components/tutorial-view/styles.js +0 -65
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kitchen-simulator",
|
|
3
|
-
"version": "5.0.0-test.
|
|
3
|
+
"version": "5.0.0-test.17",
|
|
4
4
|
"description": "It is a kitchen simulator.",
|
|
5
5
|
"main": "src/_index.js",
|
|
6
6
|
"module": "src/_index.js",
|
|
@@ -37,16 +37,8 @@
|
|
|
37
37
|
"LICENSE",
|
|
38
38
|
|
|
39
39
|
"src/components/_export.js",
|
|
40
|
-
"src/components/
|
|
41
|
-
"src/components/
|
|
42
|
-
"src/components/molecules",
|
|
43
|
-
"src/components/style",
|
|
44
|
-
"src/components/tutorial-view",
|
|
45
|
-
"src/components/viewer2d",
|
|
46
|
-
"src/components/viewer3d",
|
|
47
|
-
"src/components/content.jsx",
|
|
48
|
-
"src/components/catalog-view.jsx",
|
|
49
|
-
"src/components/project-configurator.jsx"
|
|
40
|
+
"src/components/viewer2d/*",
|
|
41
|
+
"src/components/viewer3d/*"
|
|
50
42
|
],
|
|
51
43
|
|
|
52
44
|
"sideEffects": [
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
Models as PlannerModels,
|
|
23
23
|
Plugins as PlannerPlugins,
|
|
24
24
|
reducer as PlannerReducer
|
|
25
|
-
} from '../src/
|
|
25
|
+
} from '../src/_index';
|
|
26
26
|
import { Map } from 'immutable';
|
|
27
27
|
import ReactGA from 'react-ga4';
|
|
28
28
|
import { hotjar } from 'react-hotjar';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Dialog from '@material-ui/core/Dialog';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import convert from 'convert-units';
|
|
4
|
-
import { Plugins as PlannerPlugins } from './
|
|
4
|
+
import { Plugins as PlannerPlugins } from './_index';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import React, { Component } from 'react';
|
|
7
7
|
import ReactGA from 'react-ga4';
|
|
@@ -20,11 +20,9 @@ import {
|
|
|
20
20
|
TEXT_COLOR_NEUTRAL_1
|
|
21
21
|
} from './constants';
|
|
22
22
|
import { base64Decode, getPath } from './utils/helper';
|
|
23
|
-
import actions from './actions/
|
|
23
|
+
import actions from './actions/_export';
|
|
24
24
|
import Catalog from './catalog/catalog';
|
|
25
25
|
import { Content } from './components/_export';
|
|
26
|
-
import jwtService from './components/login/jwtService';
|
|
27
|
-
import './styles/export';
|
|
28
26
|
import Translator from './translator/translator';
|
|
29
27
|
import { objectsMap } from './utils/objects-utils';
|
|
30
28
|
import { VERSION } from './version';
|
|
@@ -147,8 +145,6 @@ class KitchenConfigurator extends Component {
|
|
|
147
145
|
ttclid: utmRequestData?.ttclid || 'ttclid'
|
|
148
146
|
};
|
|
149
147
|
|
|
150
|
-
this.jwtCheck();
|
|
151
|
-
|
|
152
148
|
this.openFloor = this.openFloor.bind(this);
|
|
153
149
|
this.openCabinet = this.openCabinet.bind(this);
|
|
154
150
|
this.openFinishing = this.openFinishing.bind(this);
|
|
@@ -298,46 +294,6 @@ class KitchenConfigurator extends Component {
|
|
|
298
294
|
).parentElement.parentElement.style.zIndex = 6;
|
|
299
295
|
}
|
|
300
296
|
|
|
301
|
-
jwtCheck() {
|
|
302
|
-
jwtService.on('onAutoLogin', () => {
|
|
303
|
-
// this.props.showMessage({message: 'Logging in with JWT'});
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Sign in and retrieve user data from Api
|
|
307
|
-
*/
|
|
308
|
-
jwtService
|
|
309
|
-
.signInWithToken()
|
|
310
|
-
.then(user => {
|
|
311
|
-
//this.props.userActions.setUserData(user);
|
|
312
|
-
this.props.userActions.login(
|
|
313
|
-
user.id,
|
|
314
|
-
user.role,
|
|
315
|
-
jwtService.getAccessToken(),
|
|
316
|
-
this.utm
|
|
317
|
-
);
|
|
318
|
-
//this.props.showMessage(option)
|
|
319
|
-
//this.props.showMessage({message: 'Logged in with token data', variant: 'success'});
|
|
320
|
-
//alert('Logged in with token data');
|
|
321
|
-
})
|
|
322
|
-
.catch(error => {
|
|
323
|
-
//this.props.showMessage({message: error});
|
|
324
|
-
this.setState({
|
|
325
|
-
isSnackBarOpen: true,
|
|
326
|
-
snackBarMessage: error
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
|
|
331
|
-
jwtService.on('onAutoLogout', message => {
|
|
332
|
-
if (message) {
|
|
333
|
-
//this.props.showMessage({message, variant: 'error'});
|
|
334
|
-
}
|
|
335
|
-
this.props.userActions.logout();
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
jwtService.init();
|
|
339
|
-
}
|
|
340
|
-
|
|
341
297
|
getChildContext() {
|
|
342
298
|
return {
|
|
343
299
|
...objectsMap(actions, actionNamespace => this.props[actionNamespace]),
|
package/src/_index.js
CHANGED
|
@@ -6,8 +6,8 @@ import _KitchenConfigurator from './_KitchenConfigurator';
|
|
|
6
6
|
import Plugins from './plugins/export';
|
|
7
7
|
import * as KitchenConfiguratorConstants from './constants';
|
|
8
8
|
import * as KitchenConfiguratorSharedStyle from './shared-style';
|
|
9
|
-
import KitchenConfiguratorComponents from './components/
|
|
10
|
-
import KitchenConfiguratorActions from './actions/
|
|
9
|
+
import KitchenConfiguratorComponents from './components/_export';
|
|
10
|
+
import KitchenConfiguratorActions from './actions/_export';
|
|
11
11
|
import KitchenConfiguratorReducers from './reducers/export';
|
|
12
12
|
import KitchenConfiguratorClasses from './class/export';
|
|
13
13
|
import ElementsFactories from './catalog/factories/export';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as projectActions from './project-actions';
|
|
2
|
+
import * as viewer2DActions from './viewer2d-actions';
|
|
3
|
+
import * as viewer3DActions from './viewer3d-actions';
|
|
4
|
+
import * as linesActions from './lines-actions';
|
|
5
|
+
import * as holesActions from './holes-actions';
|
|
6
|
+
import * as sceneActions from './scene-actions';
|
|
7
|
+
import * as verticesActions from './vertices-actions';
|
|
8
|
+
import * as itemsActions from './items-actions';
|
|
9
|
+
import * as areaActions from './area-actions';
|
|
10
|
+
import * as groupsActions from './groups-actions';
|
|
11
|
+
export {
|
|
12
|
+
projectActions,
|
|
13
|
+
viewer2DActions,
|
|
14
|
+
viewer3DActions,
|
|
15
|
+
linesActions,
|
|
16
|
+
holesActions,
|
|
17
|
+
sceneActions,
|
|
18
|
+
verticesActions,
|
|
19
|
+
itemsActions,
|
|
20
|
+
areaActions,
|
|
21
|
+
groupsActions
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
projectActions,
|
|
26
|
+
viewer2DActions,
|
|
27
|
+
viewer3DActions,
|
|
28
|
+
linesActions,
|
|
29
|
+
holesActions,
|
|
30
|
+
sceneActions,
|
|
31
|
+
verticesActions,
|
|
32
|
+
itemsActions,
|
|
33
|
+
areaActions,
|
|
34
|
+
groupsActions
|
|
35
|
+
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Snackbar from '@material-ui/core/Snackbar';
|
|
3
|
-
import { SnackbarContent } from '@material-ui/core/index';
|
|
4
|
-
import Slide from '@material-ui/core/Slide';
|
|
5
|
-
import { TEXT_COLOR_NEUTRAL_0 } from '../../../constants';
|
|
6
|
-
|
|
7
|
-
const SnackBar = ({
|
|
8
|
-
message,
|
|
9
|
-
isOpen = false,
|
|
10
|
-
autoHideDuration = !!autoHideDuration ? autoHideDuration : 5000,
|
|
11
|
-
action = '',
|
|
12
|
-
handleClose,
|
|
13
|
-
snackBarColor = TEXT_COLOR_NEUTRAL_0,
|
|
14
|
-
style
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<Snackbar
|
|
18
|
-
style={style}
|
|
19
|
-
open={isOpen}
|
|
20
|
-
autoHideDuration={autoHideDuration}
|
|
21
|
-
handleClose={handleClose}
|
|
22
|
-
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
23
|
-
TransitionComponent={Slide}
|
|
24
|
-
onClose={handleClose}
|
|
25
|
-
>
|
|
26
|
-
<SnackbarContent
|
|
27
|
-
style={{ backgroundColor: snackBarColor }}
|
|
28
|
-
action={
|
|
29
|
-
action || (
|
|
30
|
-
<img
|
|
31
|
-
onClick={handleClose}
|
|
32
|
-
style={{ float: 'right', height: 24, cursor: 'pointer' }}
|
|
33
|
-
src="/assets/img/svg/close.svg"
|
|
34
|
-
/>
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
message={<div dangerouslySetInnerHTML={{ __html: message }} />}
|
|
38
|
-
/>
|
|
39
|
-
</Snackbar>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default SnackBar;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { RadioWrapper } from './styles';
|
|
4
|
-
|
|
5
|
-
const RadioButton = ({ label, checked = false, name, value, id, onChange }) => {
|
|
6
|
-
return (
|
|
7
|
-
<RadioWrapper onClick={() => onChange(value)}>
|
|
8
|
-
<input
|
|
9
|
-
type="radio"
|
|
10
|
-
id={id}
|
|
11
|
-
name={name}
|
|
12
|
-
defaultChecked={checked}
|
|
13
|
-
value={value}
|
|
14
|
-
/>
|
|
15
|
-
<label htmlFor={id}>{label}</label>
|
|
16
|
-
</RadioWrapper>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default RadioButton;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
export const RadioWrapper = styled.div`
|
|
4
|
-
display: inline-block;
|
|
5
|
-
color: #fff;
|
|
6
|
-
margin-right: 10px;
|
|
7
|
-
|
|
8
|
-
[type='radio']:checked,
|
|
9
|
-
[type='radio']:not(:checked) {
|
|
10
|
-
position: absolute;
|
|
11
|
-
left: -9999px;
|
|
12
|
-
}
|
|
13
|
-
[type='radio']:checked + label,
|
|
14
|
-
[type='radio']:not(:checked) + label {
|
|
15
|
-
position: relative;
|
|
16
|
-
padding-left: 28px;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
line-height: 20px;
|
|
19
|
-
display: inline-block;
|
|
20
|
-
}
|
|
21
|
-
[type='radio']:checked + label:before,
|
|
22
|
-
[type='radio']:not(:checked) + label:before {
|
|
23
|
-
content: '';
|
|
24
|
-
position: absolute;
|
|
25
|
-
left: 0;
|
|
26
|
-
top: 0;
|
|
27
|
-
width: 18px;
|
|
28
|
-
height: 18px;
|
|
29
|
-
border: 1px solid #ddd;
|
|
30
|
-
border-radius: 100%;
|
|
31
|
-
background: #fff;
|
|
32
|
-
}
|
|
33
|
-
[type='radio']:checked + label:after,
|
|
34
|
-
[type='radio']:not(:checked) + label:after {
|
|
35
|
-
content: '';
|
|
36
|
-
width: 12px;
|
|
37
|
-
height: 12px;
|
|
38
|
-
background: #000;
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 4px;
|
|
41
|
-
left: 4px;
|
|
42
|
-
border-radius: 100%;
|
|
43
|
-
-webkit-transition: all 0.2s ease;
|
|
44
|
-
transition: all 0.2s ease;
|
|
45
|
-
}
|
|
46
|
-
[type='radio']:not(:checked) + label:after {
|
|
47
|
-
opacity: 0;
|
|
48
|
-
-webkit-transform: scale(0);
|
|
49
|
-
transform: scale(0);
|
|
50
|
-
}
|
|
51
|
-
[type='radio']:checked + label:after {
|
|
52
|
-
opacity: 1;
|
|
53
|
-
-webkit-transform: scale(1);
|
|
54
|
-
transform: scale(1);
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import {
|
|
5
|
-
BG_COLOR_0,
|
|
6
|
-
BG_COLOR_1,
|
|
7
|
-
BG_COLOR_HOVER,
|
|
8
|
-
DEFAULT_FONT_FAMILY,
|
|
9
|
-
PRIMARY_GREEN_COLOR,
|
|
10
|
-
SECONDARY_PURPLE_COLOR,
|
|
11
|
-
SHADE_DARK_GREEN_COLOR,
|
|
12
|
-
SHADE_DARK_PURPLE_COLOR,
|
|
13
|
-
SHADE_LIGHT_GREEN_COLOR,
|
|
14
|
-
SHADE_LIGHT_PURPLE_COLOR,
|
|
15
|
-
TEXT_COLOR_NEUTRAL_4
|
|
16
|
-
} from '../../constants';
|
|
17
|
-
|
|
18
|
-
/*
|
|
19
|
-
variant: primary, secondary, tertiary(default), icon, close, pagenumber;
|
|
20
|
-
size: large, small(default);
|
|
21
|
-
disabled: true, false(default);
|
|
22
|
-
text: user definition;
|
|
23
|
-
icon: user definition;
|
|
24
|
-
endIcon: user definition;
|
|
25
|
-
onClick: user definition;
|
|
26
|
-
buttonStyle: user definition;
|
|
27
|
-
textStyle: user definition;
|
|
28
|
-
imgStyle: userdefinition;
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
export default class MainButton extends Component {
|
|
32
|
-
constructor(props, context) {
|
|
33
|
-
super(props, context);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
render() {
|
|
37
|
-
const { variant, text, size, icon, endIcon, disabled } = this.props;
|
|
38
|
-
let padding = '10px 20px';
|
|
39
|
-
|
|
40
|
-
if (size === 'large') {
|
|
41
|
-
if (variant === 'icon' || variant === 'pagenumber') padding = '10px';
|
|
42
|
-
} else {
|
|
43
|
-
if (variant === 'icon' || variant === 'pagenumber') padding = '5px';
|
|
44
|
-
else padding = '5px 10px';
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const StyledButton = styled.button`
|
|
48
|
-
/* width: max-content; */
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
padding: ${padding};
|
|
53
|
-
border: ${variant === 'primary' ? '0px solid' : '1px solid'};
|
|
54
|
-
cursor: ${disabled ? 'no-drop' : 'pointer'};
|
|
55
|
-
user-select: none;
|
|
56
|
-
background-color: ${variant === 'primary'
|
|
57
|
-
? SECONDARY_PURPLE_COLOR
|
|
58
|
-
: BG_COLOR_1};
|
|
59
|
-
border-color: ${variant === 'primary' || variant === 'secondary'
|
|
60
|
-
? SECONDARY_PURPLE_COLOR
|
|
61
|
-
: BG_COLOR_1};
|
|
62
|
-
border-radius: ${variant === 'icon' ? '50%' : '5px'};
|
|
63
|
-
outline: 0;
|
|
64
|
-
height: ${size === 'large' ? '40px' : '35px'};
|
|
65
|
-
width: ${variant === 'icon' || variant === 'pagenumber'
|
|
66
|
-
? size === 'large'
|
|
67
|
-
? '40px'
|
|
68
|
-
: '35px'
|
|
69
|
-
: 'max-content'};
|
|
70
|
-
:focus {
|
|
71
|
-
box-shadow: ${!disabled &&
|
|
72
|
-
`0px 0px 5px 2px ${SHADE_LIGHT_PURPLE_COLOR}`};
|
|
73
|
-
}
|
|
74
|
-
:hover {
|
|
75
|
-
background-color: ${!disabled &&
|
|
76
|
-
(variant === 'primary' ? SHADE_LIGHT_PURPLE_COLOR : BG_COLOR_0)};
|
|
77
|
-
}
|
|
78
|
-
:active {
|
|
79
|
-
background-color: ${!disabled &&
|
|
80
|
-
(variant === 'primary' ? SHADE_DARK_PURPLE_COLOR : BG_COLOR_0)};
|
|
81
|
-
}
|
|
82
|
-
`;
|
|
83
|
-
|
|
84
|
-
const StyledLabel = styled.span`
|
|
85
|
-
color: ${disabled
|
|
86
|
-
? TEXT_COLOR_NEUTRAL_4
|
|
87
|
-
: variant === 'primary'
|
|
88
|
-
? BG_COLOR_1
|
|
89
|
-
: SECONDARY_PURPLE_COLOR};
|
|
90
|
-
font-family: ${DEFAULT_FONT_FAMILY};
|
|
91
|
-
font-size: 13px;
|
|
92
|
-
font-weight: 600;
|
|
93
|
-
line-height: 18px;
|
|
94
|
-
text-align: center;
|
|
95
|
-
`;
|
|
96
|
-
|
|
97
|
-
const StyledImage = styled.img`
|
|
98
|
-
height: ${size === 'large' ? '20px' : '15px'};
|
|
99
|
-
width: ${size === 'large' ? '20px' : '15px'};
|
|
100
|
-
background-color: ${disabled
|
|
101
|
-
? TEXT_COLOR_NEUTRAL_4
|
|
102
|
-
: variant !== 'primary'
|
|
103
|
-
? SECONDARY_PURPLE_COLOR
|
|
104
|
-
: BG_COLOR_1};
|
|
105
|
-
-webkit-mask-image: url(${props => props.maskImage + '?nocache=2025'});
|
|
106
|
-
-webkit-mask-size: 90%;
|
|
107
|
-
-webkit-mask-repeat: no-repeat;
|
|
108
|
-
-webkit-mask-position: center;
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
if (variant === 'icon' && text)
|
|
112
|
-
console.log('If your variant is icon, you cannnot use text');
|
|
113
|
-
if (variant === 'icon' && endIcon)
|
|
114
|
-
console.log('If your variant is icon, you cannnot use endIcon');
|
|
115
|
-
if (variant === 'icon' && (icon || endIcon))
|
|
116
|
-
console.log(
|
|
117
|
-
'If your variant is pagenumber, you cannnot use icon or endIcon'
|
|
118
|
-
);
|
|
119
|
-
if (variant === 'close' && icon)
|
|
120
|
-
console.log('If your variant is close, you cannnot use icon');
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<StyledButton
|
|
124
|
-
onClick={!disabled && this.props.onClick}
|
|
125
|
-
style={{ ...this.props.buttonStyle }}
|
|
126
|
-
>
|
|
127
|
-
{variant !== 'pagenumber' && variant !== 'close' && icon && (
|
|
128
|
-
<StyledImage
|
|
129
|
-
style={{
|
|
130
|
-
...this.props.imgStyle,
|
|
131
|
-
marginRight: variant !== 'icon' && 10
|
|
132
|
-
}}
|
|
133
|
-
maskImage={icon}
|
|
134
|
-
/>
|
|
135
|
-
)}
|
|
136
|
-
{variant !== 'icon' && (
|
|
137
|
-
<StyledLabel style={{ ...this.props.textStyle }}>
|
|
138
|
-
{variant === 'pagenumber'
|
|
139
|
-
? parseInt(text)
|
|
140
|
-
? parseInt(text)
|
|
141
|
-
: 0
|
|
142
|
-
: text}
|
|
143
|
-
</StyledLabel>
|
|
144
|
-
)}
|
|
145
|
-
{variant !== 'pagenumber' && variant !== 'icon' && endIcon && (
|
|
146
|
-
<StyledImage style={{ marginLeft: 10 }} maskImage={endIcon} />
|
|
147
|
-
)}
|
|
148
|
-
</StyledButton>
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
MainButton.propTypes = {
|
|
154
|
-
variant: PropTypes.string.isRequired,
|
|
155
|
-
size: PropTypes.string.isRequired,
|
|
156
|
-
onClick: PropTypes.func
|
|
157
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
|
|
5
|
-
const Toggle = styled.div`
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
position: relative;
|
|
9
|
-
height: 36px;
|
|
10
|
-
margin-left: 20px;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
font-size: 14px;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
-webkit-user-select: none;
|
|
15
|
-
-moz-user-select: none;
|
|
16
|
-
-ms-user-select: none;
|
|
17
|
-
user-select: none;
|
|
18
|
-
:hover {
|
|
19
|
-
box-shadow: 0px 3px 5px -1px rgba(156, 154, 154, 0.2),
|
|
20
|
-
0px 6px 10px 0px rgba(156, 154, 154, 0.39),
|
|
21
|
-
0px 1px 18px 0px rgba(156, 154, 154, 0.12);
|
|
22
|
-
border-radius: 18px;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
const ToggleIcon = styled.div`
|
|
27
|
-
${'' /* transition-duration: .3s; */}
|
|
28
|
-
position: absolute;
|
|
29
|
-
top: 0px;
|
|
30
|
-
img {
|
|
31
|
-
font-size: 1.4rem;
|
|
32
|
-
box-sizing: border-box;
|
|
33
|
-
border-radius: 50%;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
export default class ToggleMeasureButton extends Component {
|
|
38
|
-
constructor(props, context) {
|
|
39
|
-
super(props, context);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
render() {
|
|
43
|
-
let { props } = this;
|
|
44
|
-
let activeStyle = props.showMeasure === 0 ? { left: 0 } : { right: 0 };
|
|
45
|
-
return (
|
|
46
|
-
<Toggle onClick={props.onClick} style={{ ...props.style }}>
|
|
47
|
-
{props.backgroundImage}
|
|
48
|
-
{[
|
|
49
|
-
props.icon !== undefined ? (
|
|
50
|
-
<ToggleIcon style={{ ...activeStyle }} key={props.icon}>
|
|
51
|
-
{props.icon}
|
|
52
|
-
</ToggleIcon>
|
|
53
|
-
) : null
|
|
54
|
-
]}
|
|
55
|
-
</Toggle>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
ToggleMeasureButton.propTypes = {
|
|
61
|
-
title: PropTypes.string,
|
|
62
|
-
hover: PropTypes.bool,
|
|
63
|
-
active: PropTypes.bool.isRequired,
|
|
64
|
-
onClick: PropTypes.func
|
|
65
|
-
};
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Viewer2D from './viewer2d/viewer2d';
|
|
4
|
-
import Viewer3D from './viewer3d/viewer3d';
|
|
5
|
-
import Viewer3DFirstPerson from './viewer3d/viewer3d-first-person';
|
|
6
|
-
import CatalogList from './catalog-view/catalog-list';
|
|
7
|
-
import ProjectConfigurator from './configurator/project-configurator';
|
|
8
|
-
import * as constants from '../constants';
|
|
9
|
-
import Front3D from './viewer3d/front3D';
|
|
10
|
-
|
|
11
|
-
export default function Content(
|
|
12
|
-
{
|
|
13
|
-
width,
|
|
14
|
-
height,
|
|
15
|
-
state,
|
|
16
|
-
customContents,
|
|
17
|
-
match,
|
|
18
|
-
setToolbar,
|
|
19
|
-
replaceCabinet,
|
|
20
|
-
keyDownEnable,
|
|
21
|
-
catalog
|
|
22
|
-
},
|
|
23
|
-
{ projectActions }
|
|
24
|
-
) {
|
|
25
|
-
let mode = state.get('mode');
|
|
26
|
-
|
|
27
|
-
switch (mode) {
|
|
28
|
-
// this mode is when view elevation
|
|
29
|
-
case constants.MODE_ELEVATION_VIEW:
|
|
30
|
-
return (
|
|
31
|
-
<Front3D
|
|
32
|
-
state={state}
|
|
33
|
-
width={width}
|
|
34
|
-
height={height}
|
|
35
|
-
setToolbar={setToolbar}
|
|
36
|
-
replaceCabinet={replaceCabinet}
|
|
37
|
-
keyDownEnable={keyDownEnable}
|
|
38
|
-
catalog={catalog}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
case constants.MODE_3D_VIEW:
|
|
43
|
-
return (
|
|
44
|
-
<Viewer3D
|
|
45
|
-
id="viewer3D"
|
|
46
|
-
state={state}
|
|
47
|
-
width={width}
|
|
48
|
-
height={height}
|
|
49
|
-
setToolbar={setToolbar}
|
|
50
|
-
replaceCabinet={replaceCabinet}
|
|
51
|
-
keyDownEnable={keyDownEnable}
|
|
52
|
-
downloadFlag={false}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
case constants.MODE_3D_FIRST_PERSON:
|
|
57
|
-
return (
|
|
58
|
-
<Viewer3DFirstPerson state={state} width={width} height={height} />
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
case constants.MODE_VIEWING_CATALOG:
|
|
62
|
-
return (
|
|
63
|
-
<CatalogList
|
|
64
|
-
state={state}
|
|
65
|
-
param={match}
|
|
66
|
-
width={width}
|
|
67
|
-
height={height}
|
|
68
|
-
categoryData={this.props.categoryData}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
case constants.MODE_IDLE:
|
|
73
|
-
case constants.MODE_2D_ZOOM_IN:
|
|
74
|
-
case constants.MODE_2D_ZOOM_OUT:
|
|
75
|
-
case constants.MODE_2D_PAN:
|
|
76
|
-
case constants.MODE_WAITING_DRAWING_LINE:
|
|
77
|
-
case constants.MODE_DRAGGING_LINE:
|
|
78
|
-
case constants.MODE_DRAGGING_VERTEX:
|
|
79
|
-
case constants.MODE_DRAGGING_ITEM:
|
|
80
|
-
case constants.MODE_DRAWING_LINE:
|
|
81
|
-
case constants.MODE_DRAWING_HOLE:
|
|
82
|
-
case constants.MODE_DRAWING_ITEM:
|
|
83
|
-
case constants.MODE_DRAGGING_HOLE:
|
|
84
|
-
case constants.MODE_ROTATING_ITEM:
|
|
85
|
-
return (
|
|
86
|
-
<Viewer2D
|
|
87
|
-
state={state}
|
|
88
|
-
width={width}
|
|
89
|
-
height={height}
|
|
90
|
-
setToolbar={setToolbar}
|
|
91
|
-
replaceCabinet={replaceCabinet}
|
|
92
|
-
/>
|
|
93
|
-
);
|
|
94
|
-
case constants.MODE_ROTATING_ITEM_3D:
|
|
95
|
-
case constants.MODE_DRAGGING_ITEM_3D:
|
|
96
|
-
case constants.MODE_IDLE_3D:
|
|
97
|
-
case constants.MODE_DRAWING_ITEM_3D:
|
|
98
|
-
case constants.MODE_DRAWING_HOLE_3D:
|
|
99
|
-
case constants.MODE_DRAGGING_HOLE_3D:
|
|
100
|
-
return (
|
|
101
|
-
<Viewer3D
|
|
102
|
-
id="viewer3D"
|
|
103
|
-
state={state}
|
|
104
|
-
width={width}
|
|
105
|
-
height={height}
|
|
106
|
-
setToolbar={setToolbar}
|
|
107
|
-
replaceCabinet={replaceCabinet}
|
|
108
|
-
keyDownEnable={keyDownEnable}
|
|
109
|
-
downloadFlag={false}
|
|
110
|
-
/>
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
case constants.MODE_CONFIGURING_PROJECT:
|
|
114
|
-
return (
|
|
115
|
-
<ProjectConfigurator width={width} height={height} state={state} />
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
default:
|
|
119
|
-
if (customContents.hasOwnProperty(mode)) {
|
|
120
|
-
let CustomContent = customContents[mode];
|
|
121
|
-
return <CustomContent width={width} height={height} state={state} />;
|
|
122
|
-
} else {
|
|
123
|
-
throw new Error(`Mode ${mode} doesn't have a mapped content`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
Content.propTypes = {
|
|
129
|
-
state: PropTypes.object.isRequired,
|
|
130
|
-
width: PropTypes.number.isRequired,
|
|
131
|
-
height: PropTypes.number.isRequired,
|
|
132
|
-
replaceCabinet: PropTypes.func.isRequired
|
|
133
|
-
};
|
|
134
|
-
Content.contextTypes = {
|
|
135
|
-
projectActions: PropTypes.object.isRequired
|
|
136
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Slider as BaseSlider } from 'infinite-react-carousel';
|
|
3
|
-
|
|
4
|
-
import * as S from './styles';
|
|
5
|
-
import './styles.scss';
|
|
6
|
-
|
|
7
|
-
const Slider = ({ children }) => {
|
|
8
|
-
return (
|
|
9
|
-
<BaseSlider arrows={false} dots={true}>
|
|
10
|
-
{children}
|
|
11
|
-
</BaseSlider>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default Slider;
|
|
File without changes
|