kitchen-simulator 5.0.0-test.17 → 5.0.0-test.18
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 +11 -3
- package/src/_KitchenConfigurator.jsx +0 -88
- package/src/components/atoms/Snackbar/index.jsx +43 -0
- package/src/components/atoms/radio-button/index.jsx +20 -0
- package/src/components/atoms/radio-button/styles.js +56 -0
- package/src/components/button/MainButton.jsx +157 -0
- package/src/components/button/ToggleMeasureButton.jsx +65 -0
- package/src/components/content.jsx +136 -0
- package/src/components/molecules/slider/index.jsx +15 -0
- package/src/components/molecules/slider/styles.js +0 -0
- package/src/components/molecules/slider/styles.scss +3 -0
- package/src/components/style/button.jsx +95 -0
- package/src/components/style/cancel-button.jsx +20 -0
- package/src/components/style/content-container.jsx +29 -0
- package/src/components/style/content-title.jsx +20 -0
- package/src/components/style/delete-button.jsx +23 -0
- package/src/components/style/export.jsx +48 -0
- package/src/components/style/form-block.jsx +13 -0
- package/src/components/style/form-color-input.jsx +27 -0
- package/src/components/style/form-label.jsx +15 -0
- package/src/components/style/form-number-input.jsx +196 -0
- package/src/components/style/form-number-input_2.jsx +191 -0
- package/src/components/style/form-select.jsx +38 -0
- package/src/components/style/form-slider.jsx +36 -0
- package/src/components/style/form-submit-button.jsx +23 -0
- package/src/components/style/form-text-input.jsx +65 -0
- package/src/components/tutorial-view/Modal.jsx +584 -0
- package/src/components/tutorial-view/style.css +111 -0
- package/src/components/tutorial-view/styles.js +65 -0
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.18",
|
|
4
4
|
"description": "It is a kitchen simulator.",
|
|
5
5
|
"main": "src/_index.js",
|
|
6
6
|
"module": "src/_index.js",
|
|
@@ -37,8 +37,16 @@
|
|
|
37
37
|
"LICENSE",
|
|
38
38
|
|
|
39
39
|
"src/components/_export.js",
|
|
40
|
-
"src/components/
|
|
41
|
-
"src/components/
|
|
40
|
+
"src/components/atoms",
|
|
41
|
+
"src/components/button",
|
|
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"
|
|
42
50
|
],
|
|
43
51
|
|
|
44
52
|
"sideEffects": [
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import Dialog from '@material-ui/core/Dialog';
|
|
2
1
|
import axios from 'axios';
|
|
3
2
|
import convert from 'convert-units';
|
|
4
3
|
import { Plugins as PlannerPlugins } from './_index';
|
|
@@ -8,17 +7,7 @@ import ReactGA from 'react-ga4';
|
|
|
8
7
|
import { hotjar } from 'react-hotjar';
|
|
9
8
|
import { connect } from 'react-redux';
|
|
10
9
|
import { bindActionCreators } from 'redux';
|
|
11
|
-
import styled from 'styled-components';
|
|
12
|
-
import SnackBar from './components/atoms/Snackbar';
|
|
13
10
|
import * as constants from './constants';
|
|
14
|
-
import {
|
|
15
|
-
BG_COLOR_HOVER,
|
|
16
|
-
CLIENTS_NAME,
|
|
17
|
-
DEFAULT_FONT_FAMILY,
|
|
18
|
-
PRIMARY_GREEN_COLOR,
|
|
19
|
-
SECONDARY_PURPLE_COLOR,
|
|
20
|
-
TEXT_COLOR_NEUTRAL_1
|
|
21
|
-
} from './constants';
|
|
22
11
|
import { base64Decode, getPath } from './utils/helper';
|
|
23
12
|
import actions from './actions/_export';
|
|
24
13
|
import Catalog from './catalog/catalog';
|
|
@@ -27,49 +16,7 @@ import Translator from './translator/translator';
|
|
|
27
16
|
import { objectsMap } from './utils/objects-utils';
|
|
28
17
|
import { VERSION } from './version';
|
|
29
18
|
|
|
30
|
-
const AWS = require('aws-sdk');
|
|
31
|
-
|
|
32
|
-
const StyledDialog = styled(Dialog)`
|
|
33
|
-
.MuiDialog-paperWidthSm {
|
|
34
|
-
border-radius: 10px;
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
|
|
38
|
-
export const StyledDialogContent = styled.span`
|
|
39
|
-
font-family: ${DEFAULT_FONT_FAMILY};
|
|
40
|
-
color: ${TEXT_COLOR_NEUTRAL_1};
|
|
41
|
-
padding: 10px 30px;
|
|
42
|
-
padding-top: 30px;
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
export const StyledDialogAction = styled.div`
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: flex-end;
|
|
48
|
-
padding: 15px 30px 25px;
|
|
49
|
-
`;
|
|
50
|
-
|
|
51
|
-
export const StyledButton = styled.div`
|
|
52
|
-
padding: 10px 20px;
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
margin-right: 10px;
|
|
55
|
-
color: ${SECONDARY_PURPLE_COLOR};
|
|
56
|
-
font-weight: bold;
|
|
57
|
-
font-family: ${DEFAULT_FONT_FAMILY};
|
|
58
|
-
font-size: 16px;
|
|
59
|
-
border-radius: 20px;
|
|
60
|
-
:hover {
|
|
61
|
-
background-color: ${BG_COLOR_HOVER};
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
const s3 = new AWS.S3({
|
|
66
|
-
accessKeyId: process.env.REACT_APP_AWS_ID,
|
|
67
|
-
secretAccessKey: process.env.REACT_APP_AWS_SECRET
|
|
68
|
-
});
|
|
69
|
-
|
|
70
19
|
const toolbarW = 0;
|
|
71
|
-
const sidebarW = 250;
|
|
72
|
-
const footerBarH = 20;
|
|
73
20
|
|
|
74
21
|
const wrapperStyle = {
|
|
75
22
|
display: 'flex',
|
|
@@ -549,41 +496,6 @@ class KitchenConfigurator extends Component {
|
|
|
549
496
|
|
|
550
497
|
return (
|
|
551
498
|
<section>
|
|
552
|
-
<SnackBar
|
|
553
|
-
isOpen={this.state.isSnackBarOpen}
|
|
554
|
-
message={this.state.snackBarMessage}
|
|
555
|
-
handleClose={() =>
|
|
556
|
-
this.setState({ isSnackBarOpen: false, snackBarMessage: '' })
|
|
557
|
-
}
|
|
558
|
-
autoHideDuration={10000}
|
|
559
|
-
/>
|
|
560
|
-
<SnackBar
|
|
561
|
-
style={{ marginTop: this.state.isSnackBarOpen ? 75 : 'unset' }}
|
|
562
|
-
isOpen={this.state.isSnackBar1Open}
|
|
563
|
-
message={`The items in your design have been added to your shopping cart at ${CLIENTS_NAME[sessionStorage.getItem('visualizerName')]}. <br />Please log in with the same email address.`}
|
|
564
|
-
autoHideDuration={20000}
|
|
565
|
-
action={
|
|
566
|
-
<div>
|
|
567
|
-
<a
|
|
568
|
-
href={this.state.redirectURL}
|
|
569
|
-
target="_blank"
|
|
570
|
-
style={{
|
|
571
|
-
fontFamily: DEFAULT_FONT_FAMILY,
|
|
572
|
-
color: PRIMARY_GREEN_COLOR,
|
|
573
|
-
fontWeight: 700,
|
|
574
|
-
marginRight: 10
|
|
575
|
-
}}
|
|
576
|
-
>
|
|
577
|
-
View Cart
|
|
578
|
-
</a>
|
|
579
|
-
<img
|
|
580
|
-
onClick={() => this.setState({ isSnackBar1Open: false })}
|
|
581
|
-
style={{ float: 'right', height: 24, cursor: 'pointer' }}
|
|
582
|
-
src="/assets/img/svg/close.svg"
|
|
583
|
-
/>
|
|
584
|
-
</div>
|
|
585
|
-
}
|
|
586
|
-
/>
|
|
587
499
|
<div style={{ ...wrapperStyle, height }}>
|
|
588
500
|
<Content
|
|
589
501
|
width={contentW}
|
|
@@ -0,0 +1,43 @@
|
|
|
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;
|
|
@@ -0,0 +1,20 @@
|
|
|
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;
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|