kitchen-simulator 5.0.0-test.7 → 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 +13 -3
- package/src/components/_export.js +11 -0
- 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 -5627
- 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
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as SharedStyle from '../../shared-style';
|
|
4
|
-
import { FaAngleDown, FaAngleUp } from 'react-icons/fa';
|
|
5
|
-
|
|
6
|
-
const STYLE = {
|
|
7
|
-
// borderTop: '1px solid #222',
|
|
8
|
-
// borderBottom: '1px solid #48494E',
|
|
9
|
-
paddingBottom: '1px',
|
|
10
|
-
margin: '2px',
|
|
11
|
-
userSelect: 'none'
|
|
12
|
-
};
|
|
13
|
-
const STYLE_TITLE = {
|
|
14
|
-
fontSize: '14px',
|
|
15
|
-
color: 'rgba(222, 222, 222, 1)',
|
|
16
|
-
padding: '5px 15px 8px 15px',
|
|
17
|
-
backgroundColor: '#3e3e3f',
|
|
18
|
-
textShadow: '-1px -1px 2px rgba(0, 0, 0, 1)',
|
|
19
|
-
// boxShadow: 'inset 0px -3px 19px 0px rgba(0,0,0,0.5)',
|
|
20
|
-
margin: '0px',
|
|
21
|
-
cursor: 'pointer',
|
|
22
|
-
display: 'flex',
|
|
23
|
-
justifyContent: 'start',
|
|
24
|
-
alignItems: 'center'
|
|
25
|
-
};
|
|
26
|
-
const STYLE_CONTENT = {
|
|
27
|
-
fontSize: '13px',
|
|
28
|
-
color: '#000',
|
|
29
|
-
padding: '0px'
|
|
30
|
-
};
|
|
31
|
-
const STYLE_ARROW = {
|
|
32
|
-
float: 'right'
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default class Panel extends Component {
|
|
36
|
-
constructor(props, context) {
|
|
37
|
-
super(props, context);
|
|
38
|
-
|
|
39
|
-
this.state = {
|
|
40
|
-
opened: props.hasOwnProperty('opened') ? props.opened : false,
|
|
41
|
-
hover: false
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
toggleOpen() {
|
|
46
|
-
this.setState({ opened: !this.state.opened });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
toggleHover() {
|
|
50
|
-
this.setState({ hover: !this.state.hover });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
render() {
|
|
54
|
-
let { name, isUrl, url, headComponents, children } = this.props;
|
|
55
|
-
let { opened, hover } = this.state;
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<div style={STYLE}>
|
|
59
|
-
<div style={{ ...STYLE_CONTENT, display: opened ? 'block' : 'none' }}>
|
|
60
|
-
{children}
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
Panel.propTypes = {
|
|
68
|
-
name: PropTypes.string.isRequired,
|
|
69
|
-
headComponents: PropTypes.array,
|
|
70
|
-
opened: PropTypes.bool
|
|
71
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import PanelElementEditor from './panel-element-editor/panel-element-editor';
|
|
4
|
-
import PanelGroupEditor from './panel-group-editor';
|
|
5
|
-
import PanelMultiElementsEditor from './panel-element-editor/panel-multi-elements-editor';
|
|
6
|
-
import PanelLayers from './panel-layers';
|
|
7
|
-
import PanelGuides from './panel-guides';
|
|
8
|
-
import PanelGroups from './panel-groups';
|
|
9
|
-
import PanelLayerElements from './panel-layer-elements';
|
|
10
|
-
import * as SharedStyle from '../../shared-style';
|
|
11
|
-
import If from '../../utils/react-if';
|
|
12
|
-
|
|
13
|
-
const STYLE = {
|
|
14
|
-
backgroundColor: SharedStyle.PRIMARY_COLOR.main,
|
|
15
|
-
display: 'block',
|
|
16
|
-
overflowY: 'auto',
|
|
17
|
-
overflowX: 'hidden',
|
|
18
|
-
paddingBottom: '20px'
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const sortButtonsCb = (a, b) => {
|
|
22
|
-
if (a.index === undefined || a.index === null) {
|
|
23
|
-
a.index = Number.MAX_SAFE_INTEGER;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (b.index === undefined || b.index === null) {
|
|
27
|
-
b.index = Number.MAX_SAFE_INTEGER;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return a.index - b.index;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const mapButtonsCb = (el, ind) => (
|
|
34
|
-
<If key={ind} condition={el.condition} style={{ position: 'relative' }}>
|
|
35
|
-
{el.dom}
|
|
36
|
-
</If>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export default function Sidebar({ state, width, height, sidebarComponents }) {
|
|
40
|
-
let selectedLayer = state.getIn(['scene', 'selectedLayer']);
|
|
41
|
-
|
|
42
|
-
//TODO change in multi-layer check
|
|
43
|
-
let selected = state.getIn(['scene', 'layers', selectedLayer, 'selected']);
|
|
44
|
-
|
|
45
|
-
let multiselected =
|
|
46
|
-
selected.lines.size > 1 ||
|
|
47
|
-
selected.items.size > 1 ||
|
|
48
|
-
selected.holes.size > 1 ||
|
|
49
|
-
selected.areas.size > 1 ||
|
|
50
|
-
selected.lines.size +
|
|
51
|
-
selected.items.size +
|
|
52
|
-
selected.holes.size +
|
|
53
|
-
selected.areas.size >
|
|
54
|
-
1;
|
|
55
|
-
|
|
56
|
-
let selectedGroup = state
|
|
57
|
-
.getIn(['scene', 'groups'])
|
|
58
|
-
.findEntry(g => g.get('selected'));
|
|
59
|
-
|
|
60
|
-
let sorter = [
|
|
61
|
-
// { index: 0, condition: true, dom: <PanelGuides state={state}/> },
|
|
62
|
-
// { index: 1, condition: true, dom: <PanelLayers state={state} /> },
|
|
63
|
-
// { index: 2, condition: true, dom: <PanelLayerElements mode={state.mode} layers={state.scene.layers} selectedLayer={state.scene.selectedLayer} /> },
|
|
64
|
-
// { index: 3, condition: true, dom: <PanelGroups mode={state.mode} groups={state.scene.groups} layers={state.scene.layers} /> },
|
|
65
|
-
{
|
|
66
|
-
index: 4,
|
|
67
|
-
condition: !multiselected,
|
|
68
|
-
dom: <PanelElementEditor state={state} planData={{}} />
|
|
69
|
-
}
|
|
70
|
-
//{ index: 5, condition: multiselected, dom: <PanelMultiElementsEditor state={state} /> },
|
|
71
|
-
// { index: 6, condition: !!selectedGroup, dom: <PanelGroupEditor state={state} groupID={selectedGroup ? selectedGroup[0] : null} /> }
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
sorter = sorter.concat(
|
|
75
|
-
sidebarComponents.map((Component, key) => {
|
|
76
|
-
return Component.prototype //if is a react component
|
|
77
|
-
? {
|
|
78
|
-
condition: true,
|
|
79
|
-
dom: React.createElement(Component, { state, key })
|
|
80
|
-
}
|
|
81
|
-
: {
|
|
82
|
-
//else is a sortable toolbar button
|
|
83
|
-
index: Component.index,
|
|
84
|
-
condition: Component.condition,
|
|
85
|
-
dom: React.createElement(Component.dom, { state, key })
|
|
86
|
-
};
|
|
87
|
-
})
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<aside
|
|
92
|
-
style={{ width, height, ...STYLE }}
|
|
93
|
-
onKeyDown={event => event.stopPropagation()}
|
|
94
|
-
onKeyUp={event => event.stopPropagation()}
|
|
95
|
-
className="sidebar"
|
|
96
|
-
>
|
|
97
|
-
{sorter.sort(sortButtonsCb).map(mapButtonsCb)}
|
|
98
|
-
</aside>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
Sidebar.propTypes = {
|
|
103
|
-
state: PropTypes.object.isRequired,
|
|
104
|
-
width: PropTypes.number.isRequired,
|
|
105
|
-
height: PropTypes.number.isRequired
|
|
106
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as SharedStyle from '../../shared-style';
|
|
4
|
-
import { FaAngleDown, FaAngleUp } from 'react-icons/fa';
|
|
5
|
-
|
|
6
|
-
const STYLE = {
|
|
7
|
-
// borderTop: '1px solid #222',
|
|
8
|
-
// borderBottom: '2px solid #2f2f2f',
|
|
9
|
-
// paddingBottom: '5px',
|
|
10
|
-
// marginTop: '5px',
|
|
11
|
-
userSelect: 'none',
|
|
12
|
-
width: '100%'
|
|
13
|
-
};
|
|
14
|
-
const STYLE_TITLE1 = {
|
|
15
|
-
fontSize: '12px',
|
|
16
|
-
padding: '8px 15px',
|
|
17
|
-
backgroundColor: '#3e3e3f',
|
|
18
|
-
margin: '0px',
|
|
19
|
-
cursor: 'pointer',
|
|
20
|
-
display: 'flex',
|
|
21
|
-
height: '90px',
|
|
22
|
-
justifyContent: 'start',
|
|
23
|
-
alignItems: 'center'
|
|
24
|
-
};
|
|
25
|
-
const STYLE_TITLE2 = {
|
|
26
|
-
fontSize: '12px',
|
|
27
|
-
padding: '8px 15px',
|
|
28
|
-
backgroundColor: '#2f2f2f',
|
|
29
|
-
margin: '0px',
|
|
30
|
-
cursor: 'pointer',
|
|
31
|
-
display: 'flex',
|
|
32
|
-
height: '30px',
|
|
33
|
-
justifyContent: 'start'
|
|
34
|
-
// alignItems: 'center'
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const STYLE_CONTENT1 = {
|
|
38
|
-
fontSize: '11px',
|
|
39
|
-
color: 'rgba(222, 222, 222, 1)',
|
|
40
|
-
padding: '0px',
|
|
41
|
-
backgroundColor: '#28292d'
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const STYLE_CONTENT2 = {
|
|
45
|
-
fontSize: '11px',
|
|
46
|
-
color: 'rgba(222, 222, 222, 1)',
|
|
47
|
-
padding: '0px'
|
|
48
|
-
// backgroundColor: '#28292d',
|
|
49
|
-
};
|
|
50
|
-
const STYLE_ARROW = {
|
|
51
|
-
float: 'right'
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default class ToolbarPanel extends Component {
|
|
55
|
-
constructor(props, context) {
|
|
56
|
-
super(props, context);
|
|
57
|
-
|
|
58
|
-
this.state = {
|
|
59
|
-
lastActiveName:
|
|
60
|
-
props.lastActiveName === undefined ? props.lastActiveName : '',
|
|
61
|
-
opened: props.hasOwnProperty('opened') ? props.opened : false,
|
|
62
|
-
hover: false
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
componentWillUpdate(nextProps, nextState) {
|
|
67
|
-
if (
|
|
68
|
-
nextProps.lastActiveName !== undefined &&
|
|
69
|
-
nextProps.name !== undefined
|
|
70
|
-
) {
|
|
71
|
-
if (
|
|
72
|
-
nextProps.lastActiveName !== '' &&
|
|
73
|
-
nextProps.name !== nextProps.lastActiveName
|
|
74
|
-
) {
|
|
75
|
-
nextState.opened = false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
toggleOpen() {
|
|
81
|
-
if (this.state.opened === false) {
|
|
82
|
-
this.props.onOpen();
|
|
83
|
-
} else {
|
|
84
|
-
this.props.onClose();
|
|
85
|
-
}
|
|
86
|
-
if (this.props.setLastActiveName !== undefined) {
|
|
87
|
-
this.props.setLastActiveName(this.props.name);
|
|
88
|
-
}
|
|
89
|
-
this.setState({ opened: !this.state.opened });
|
|
90
|
-
}
|
|
91
|
-
toggleHover() {
|
|
92
|
-
this.setState({ hover: !this.state.hover });
|
|
93
|
-
}
|
|
94
|
-
render() {
|
|
95
|
-
let { name, isUrl, url, headComponents, children } = this.props;
|
|
96
|
-
let { opened, hover } = this.state;
|
|
97
|
-
|
|
98
|
-
const STYLE_TITLE = isUrl ? STYLE_TITLE1 : STYLE_TITLE2;
|
|
99
|
-
const STYLE_CONTENT = isUrl ? STYLE_CONTENT1 : STYLE_CONTENT2;
|
|
100
|
-
|
|
101
|
-
name = name.charAt(0).toUpperCase() + name.substr(1);
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<div style={STYLE}>
|
|
105
|
-
<h3
|
|
106
|
-
style={{
|
|
107
|
-
...STYLE_TITLE,
|
|
108
|
-
color:
|
|
109
|
-
hover ||
|
|
110
|
-
(this.props.idx != undefined &&
|
|
111
|
-
this.props.idx === this.props.selSubOption)
|
|
112
|
-
? SharedStyle.SECONDARY_COLOR.main
|
|
113
|
-
: '#fff'
|
|
114
|
-
}}
|
|
115
|
-
onMouseEnter={() => this.toggleHover()}
|
|
116
|
-
onMouseLeave={() => this.toggleHover()}
|
|
117
|
-
onClick={() => this.toggleOpen()}
|
|
118
|
-
>
|
|
119
|
-
{isUrl === true ? (
|
|
120
|
-
<img name={name} src={url} width={50} height={50} />
|
|
121
|
-
) : (
|
|
122
|
-
''
|
|
123
|
-
)}
|
|
124
|
-
<span style={{ marginLeft: isUrl ? 23 : 0 }}> {name} </span>
|
|
125
|
-
{headComponents}
|
|
126
|
-
</h3>
|
|
127
|
-
<div style={{ ...STYLE_CONTENT, display: opened ? 'block' : 'none' }}>
|
|
128
|
-
{children}
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
ToolbarPanel.propTypes = {
|
|
136
|
-
name: PropTypes.string.isRequired,
|
|
137
|
-
headComponents: PropTypes.array,
|
|
138
|
-
opened: PropTypes.bool
|
|
139
|
-
};
|