kitchen-simulator 5.0.0-test.18 → 5.0.0-test.19
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 +8 -26
- package/src/@history.js +3 -0
- package/src/CrossSignOn.jsx +94 -0
- package/src/KitchenConfigurator.jsx +1526 -0
- package/src/KitchenConfiguratorApp.jsx +1 -1
- package/src/_KitchenConfigurator.jsx +3 -3
- package/src/components/catalog-view/catalog-breadcrumb.jsx +53 -0
- package/src/components/catalog-view/catalog-item.jsx +229 -0
- package/src/components/catalog-view/catalog-list.jsx +173 -0
- package/src/components/catalog-view/catalog-page-item.jsx +110 -0
- package/src/components/catalog-view/catalog-turn-back-page-item.jsx +80 -0
- package/src/components/configurator/custom-configurator.jsx +77 -0
- package/src/components/configurator/project-configurator.jsx +120 -0
- package/src/components/export.js +36 -0
- package/src/components/firstsetting/button/styles.js +223 -0
- package/src/components/firstsetting/export.js +9 -0
- package/src/components/firstsetting/firstsetting-content-button.jsx +198 -0
- package/src/components/firstsetting/firstsetting-toggle-button.jsx +101 -0
- package/src/components/firstsetting/firstsetting.jsx +814 -0
- package/src/components/footerbar/button/ControlButton.jsx +43 -0
- package/src/components/footerbar/button/DirectionButton.jsx +54 -0
- package/src/components/footerbar/button/DirectionPanSpinButton.jsx +36 -0
- package/src/components/footerbar/button/ToggleButton.jsx +58 -0
- package/src/components/footerbar/button/ToggleConvertButton.jsx +48 -0
- package/src/components/footerbar/button/ToggleMeasureButton.jsx +33 -0
- package/src/components/footerbar/button/styles.js +217 -0
- package/src/components/footerbar/export.js +9 -0
- package/src/components/footerbar/footer-content-button.jsx +198 -0
- package/src/components/footerbar/footer-toggle-button.jsx +101 -0
- package/src/components/footerbar/footerbar.jsx +1103 -0
- package/src/components/footerbar/styles.js +263 -0
- package/src/components/header/button/MenuButton.jsx +46 -0
- package/src/components/header/button/SaveButton.jsx +54 -0
- package/src/components/header/button/styles.js +181 -0
- package/src/components/header/export.js +5 -0
- package/src/components/header/header.jsx +631 -0
- package/src/components/header/header.style.css +47 -0
- package/src/components/header/styles.js +320 -0
- package/src/components/login/Login.js +77 -0
- package/src/components/login/LoginForm/index.js +108 -0
- package/src/components/login/Register.js +82 -0
- package/src/components/login/RegisterForm/index.js +171 -0
- package/src/components/login/jwtService.js +201 -0
- package/src/components/login/style.css +158 -0
- package/src/components/login/style.scss +260 -0
- package/src/components/myprojects/export.js +5 -0
- package/src/components/myprojects/index.jsx +445 -0
- package/src/components/myprojects/styles.js +241 -0
- package/src/components/sidebar/custom-accordion.jsx +48 -0
- package/src/components/sidebar/export.js +15 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +73 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +101 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +149 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +316 -0
- package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +108 -0
- package/src/components/sidebar/panel-element-editor/element-editor.jsx +1070 -0
- package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
- package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +104 -0
- package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +155 -0
- package/src/components/sidebar/panel-group-editor.jsx +272 -0
- package/src/components/sidebar/panel-groups.jsx +310 -0
- package/src/components/sidebar/panel-guides.jsx +192 -0
- package/src/components/sidebar/panel-layer-elements.jsx +298 -0
- package/src/components/sidebar/panel-layers.jsx +381 -0
- package/src/components/sidebar/panel.jsx +71 -0
- package/src/components/sidebar/sidebar.jsx +106 -0
- package/src/components/sidebar/toolbar-panel.jsx +139 -0
- package/src/components/sign/export.js +7 -0
- package/src/components/sign/main/index.jsx +523 -0
- package/src/components/sign/main/styles.js +163 -0
- package/src/components/toolbar/button/ControlButton.jsx +41 -0
- package/src/components/toolbar/button/DirectionButton.jsx +34 -0
- package/src/components/toolbar/button/RightButton.jsx +103 -0
- package/src/components/toolbar/button/ToggleButton.jsx +41 -0
- package/src/components/toolbar/button/index.jsx +55 -0
- package/src/components/toolbar/button/styles.js +127 -0
- package/src/components/toolbar/components/DoorStyleMenu.jsx +103 -0
- package/src/components/toolbar/components/Pricing.jsx +126 -0
- package/src/components/toolbar/components/ReviewForQuote.jsx +635 -0
- package/src/components/toolbar/export.js +21 -0
- package/src/components/toolbar/main/Alert.js +122 -0
- package/src/components/toolbar/main/TakePictureModal.jsx +104 -0
- package/src/components/toolbar/main/confirm-popup.jsx +99 -0
- package/src/components/toolbar/main/index.jsx +5627 -0
- package/src/components/toolbar/main/lShaped.json +311 -0
- package/src/components/toolbar/main/longNarrow.json +238 -0
- package/src/components/toolbar/main/myComponents.js +123 -0
- package/src/components/toolbar/main/oRectangle.json +220 -0
- package/src/components/toolbar/main/rectangle.json +238 -0
- package/src/components/toolbar/main/style.css +107 -0
- package/src/components/toolbar/main/styles.js +696 -0
- package/src/components/toolbar/plugin-item.jsx +123 -0
- package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +73 -0
- package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +102 -0
- package/src/components/toolbar/popup/appliance/index.jsx +83 -0
- package/src/components/toolbar/popup/autosaveprompt/index.jsx +150 -0
- package/src/components/toolbar/popup/autosaveprompt/styles.css +64 -0
- package/src/components/toolbar/popup/autosaveprompt/styles.js +40 -0
- package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +73 -0
- package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +119 -0
- package/src/components/toolbar/popup/cabinet/index.jsx +85 -0
- package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +63 -0
- package/src/components/toolbar/popup/doorStyle/index.jsx +71 -0
- package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +139 -0
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +2 -0
- package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +157 -0
- package/src/components/toolbar/popup/downloadsummary/index.jsx +643 -0
- package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +51 -0
- package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +175 -0
- package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +283 -0
- package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +2257 -0
- package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +93 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +132 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +2198 -0
- package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +152 -0
- package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +149 -0
- package/src/components/toolbar/popup/downloadsummary/styles.css +177 -0
- package/src/components/toolbar/popup/downloadsummary/styles.js +453 -0
- package/src/components/toolbar/popup/finishingtouch/category/index.jsx +34 -0
- package/src/components/toolbar/popup/finishingtouch/index.jsx +58 -0
- package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +112 -0
- package/src/components/toolbar/popup/finishingtouch/product/index.jsx +116 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +101 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +254 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +311 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +238 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +220 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +238 -0
- package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +86 -0
- package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +109 -0
- package/src/components/toolbar/popup/floorplan/index.jsx +60 -0
- package/src/components/toolbar/popup/index.jsx +241 -0
- package/src/components/toolbar/popup/newproject/index.jsx +59 -0
- package/src/components/toolbar/popup/newproject/styles.css +64 -0
- package/src/components/toolbar/popup/newproject/styles.js +41 -0
- package/src/components/toolbar/popup/product/appliance.jsx +54 -0
- package/src/components/toolbar/popup/product/cabinetproduct.jsx +15 -0
- package/src/components/toolbar/popup/product/doorstyle.jsx +58 -0
- package/src/components/toolbar/popup/product/doorstyleproduct.jsx +47 -0
- package/src/components/toolbar/popup/product/floor.jsx +36 -0
- package/src/components/toolbar/popup/product/floorproduct.jsx +42 -0
- package/src/components/toolbar/popup/product/index.jsx +36 -0
- package/src/components/toolbar/popup/product/primary.jsx +77 -0
- package/src/components/toolbar/popup/product/productline.jsx +93 -0
- package/src/components/toolbar/popup/product/reviewItem.jsx +427 -0
- package/src/components/toolbar/popup/product/reviewMolding.jsx +310 -0
- package/src/components/toolbar/popup/product/style.css +54 -0
- package/src/components/toolbar/popup/product/styles.js +260 -0
- package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +146 -0
- package/src/components/toolbar/popup/savedesign/index.jsx +495 -0
- package/src/components/toolbar/popup/savedesign/savedesign.style.css +16 -0
- package/src/components/toolbar/popup/savedesign/styles.js +151 -0
- package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +87 -0
- package/src/components/toolbar/popup/styles.js +909 -0
- package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +192 -0
- package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +96 -0
- package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +54 -0
- package/src/components/toolbar/popup/submitforquote/StepDots.jsx +25 -0
- package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +116 -0
- package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +38 -0
- package/src/components/toolbar/popup/submitforquote/index.jsx +698 -0
- package/src/components/toolbar/popup/submitforquote/styles.css +105 -0
- package/src/components/toolbar/popup/submitforquote/styles.js +294 -0
- package/src/components/toolbar/popup/submitprompt/index.jsx +89 -0
- package/src/components/toolbar/popup/submitprompt/styles.css +64 -0
- package/src/components/toolbar/popup/submitprompt/styles.js +42 -0
- package/src/components/toolbar/toolbar-button.jsx +90 -0
- package/src/components/toolbar/toolbar-load-button.jsx +36 -0
- package/src/components/toolbar/toolbar-save-button.jsx +32 -0
- package/src/components/wizardstep/button/styles.js +677 -0
- package/src/components/wizardstep/export.js +5 -0
- package/src/components/wizardstep/index.jsx +1372 -0
- package/src/components/wizardstep/styles.js +688 -0
- package/src/components/wizardstep/wizardstep-content-button.jsx +198 -0
- package/src/components/wizardstep/wizardstep-toggle-button.jsx +101 -0
- package/src/{_index.js → index.js} +4 -4
- package/src/renderer.jsx +466 -0
- package/src/actions/_export.js +0 -35
- package/src/components/_export.js +0 -11
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
};
|