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
|
File without changes
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Panel from '../panel';
|
|
4
|
+
import { Seq } from 'immutable';
|
|
5
|
+
import {
|
|
6
|
+
MODE_IDLE,
|
|
7
|
+
MODE_2D_ZOOM_IN,
|
|
8
|
+
MODE_2D_ZOOM_OUT,
|
|
9
|
+
MODE_2D_PAN,
|
|
10
|
+
MODE_3D_VIEW,
|
|
11
|
+
MODE_3D_FIRST_PERSON,
|
|
12
|
+
MODE_WAITING_DRAWING_LINE,
|
|
13
|
+
MODE_DRAWING_LINE,
|
|
14
|
+
MODE_DRAWING_HOLE,
|
|
15
|
+
MODE_DRAWING_ITEM,
|
|
16
|
+
MODE_DRAGGING_LINE,
|
|
17
|
+
MODE_DRAGGING_VERTEX,
|
|
18
|
+
MODE_DRAGGING_ITEM,
|
|
19
|
+
MODE_DRAGGING_HOLE,
|
|
20
|
+
MODE_FITTING_IMAGE,
|
|
21
|
+
MODE_UPLOADING_IMAGE,
|
|
22
|
+
MODE_ROTATING_ITEM,
|
|
23
|
+
MODE_IDLE_3D,
|
|
24
|
+
MODE_DRAGGING_ITEM_3D,
|
|
25
|
+
MODE_ROTATING_ITEM_3D,
|
|
26
|
+
MODE_DRAWING_HOLE_3D,
|
|
27
|
+
MODE_DRAGGING_HOLE_3D
|
|
28
|
+
} from '../../../constants';
|
|
29
|
+
import ElementEditor from './element-editor';
|
|
30
|
+
|
|
31
|
+
export default function PanelElementEditor(
|
|
32
|
+
{ state, planData, categoryData, getLinearOfMolding },
|
|
33
|
+
{ projectActions, translator }
|
|
34
|
+
) {
|
|
35
|
+
let { scene, mode } = state;
|
|
36
|
+
|
|
37
|
+
if (
|
|
38
|
+
![
|
|
39
|
+
MODE_IDLE,
|
|
40
|
+
MODE_2D_ZOOM_IN,
|
|
41
|
+
MODE_2D_ZOOM_OUT,
|
|
42
|
+
MODE_2D_PAN,
|
|
43
|
+
MODE_3D_VIEW,
|
|
44
|
+
MODE_3D_FIRST_PERSON,
|
|
45
|
+
MODE_WAITING_DRAWING_LINE,
|
|
46
|
+
MODE_DRAWING_LINE,
|
|
47
|
+
MODE_DRAWING_HOLE,
|
|
48
|
+
MODE_DRAWING_ITEM,
|
|
49
|
+
MODE_DRAGGING_LINE,
|
|
50
|
+
MODE_DRAGGING_VERTEX,
|
|
51
|
+
MODE_DRAGGING_ITEM,
|
|
52
|
+
MODE_DRAGGING_HOLE,
|
|
53
|
+
MODE_ROTATING_ITEM,
|
|
54
|
+
MODE_UPLOADING_IMAGE,
|
|
55
|
+
MODE_FITTING_IMAGE,
|
|
56
|
+
MODE_IDLE_3D,
|
|
57
|
+
MODE_DRAGGING_ITEM_3D,
|
|
58
|
+
MODE_ROTATING_ITEM_3D,
|
|
59
|
+
MODE_DRAWING_HOLE_3D,
|
|
60
|
+
MODE_DRAGGING_HOLE_3D
|
|
61
|
+
].includes(mode)
|
|
62
|
+
)
|
|
63
|
+
return null;
|
|
64
|
+
|
|
65
|
+
let componentRenderer = (element, layer) => (
|
|
66
|
+
<Panel
|
|
67
|
+
isUrl={false}
|
|
68
|
+
key={element.id}
|
|
69
|
+
name={translator.t('Properties: [{0}] {1}', element.type, element.id)}
|
|
70
|
+
opened={true}
|
|
71
|
+
>
|
|
72
|
+
{/* <div style={{padding: '5px 15px'}}> */}
|
|
73
|
+
|
|
74
|
+
<ElementEditor
|
|
75
|
+
element={element}
|
|
76
|
+
layer={layer}
|
|
77
|
+
state={state}
|
|
78
|
+
planData={planData}
|
|
79
|
+
categoryData={categoryData}
|
|
80
|
+
getLinearOfMolding={getLinearOfMolding}
|
|
81
|
+
/>
|
|
82
|
+
{/* </div> */}
|
|
83
|
+
</Panel>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
let layerRenderer = layer =>
|
|
87
|
+
Seq()
|
|
88
|
+
.concat(layer.lines, layer.holes, layer.areas, layer.items)
|
|
89
|
+
.filter(element => element.selected)
|
|
90
|
+
.map(element => componentRenderer(element, layer))
|
|
91
|
+
.valueSeq();
|
|
92
|
+
|
|
93
|
+
return <div>{scene.layers.valueSeq().map(layerRenderer)}</div>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
PanelElementEditor.propTypes = {
|
|
97
|
+
state: PropTypes.object.isRequired,
|
|
98
|
+
planData: PropTypes.object.isRequired
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
PanelElementEditor.contextTypes = {
|
|
102
|
+
projectActions: PropTypes.object.isRequired,
|
|
103
|
+
translator: PropTypes.object.isRequired
|
|
104
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Panel from '../panel';
|
|
4
|
+
import { Seq } from 'immutable';
|
|
5
|
+
import {
|
|
6
|
+
MODE_IDLE,
|
|
7
|
+
MODE_2D_ZOOM_IN,
|
|
8
|
+
MODE_2D_ZOOM_OUT,
|
|
9
|
+
MODE_2D_PAN,
|
|
10
|
+
MODE_3D_VIEW,
|
|
11
|
+
MODE_3D_FIRST_PERSON,
|
|
12
|
+
MODE_WAITING_DRAWING_LINE,
|
|
13
|
+
MODE_DRAWING_LINE,
|
|
14
|
+
MODE_DRAWING_HOLE,
|
|
15
|
+
MODE_DRAWING_ITEM,
|
|
16
|
+
MODE_DRAGGING_LINE,
|
|
17
|
+
MODE_DRAGGING_VERTEX,
|
|
18
|
+
MODE_DRAGGING_ITEM,
|
|
19
|
+
MODE_DRAGGING_HOLE,
|
|
20
|
+
MODE_FITTING_IMAGE,
|
|
21
|
+
MODE_UPLOADING_IMAGE,
|
|
22
|
+
MODE_ROTATING_ITEM
|
|
23
|
+
} from '../../../constants';
|
|
24
|
+
import { FormSelect } from '../../../components/style/export';
|
|
25
|
+
import { Group } from '../../../class/export';
|
|
26
|
+
|
|
27
|
+
const tableStyle = { width: '100%' };
|
|
28
|
+
const firstTdStyle = { width: '6em' };
|
|
29
|
+
|
|
30
|
+
export default class PanelMultiElementsEditor extends Component {
|
|
31
|
+
//export default function PanelMultiElementsEditor({state}, {projectActions, translator}) {
|
|
32
|
+
constructor(props, context) {
|
|
33
|
+
super(props, context);
|
|
34
|
+
|
|
35
|
+
this.state = {
|
|
36
|
+
selectedGroupID: ''
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
addSelectToGroup(state, groupID, layerID, selecteds) {
|
|
41
|
+
if (!groupID || groupID === '' || !selecteds || !selecteds.size) return;
|
|
42
|
+
|
|
43
|
+
console.log('need to be added to group', groupID, 'elements', selecteds);
|
|
44
|
+
|
|
45
|
+
/*let selectedJs = selecteds.toJS();
|
|
46
|
+
|
|
47
|
+
for( let lineID in selectedJs.lines ) Group.addElement( state, groupID, layerID, 'lines', lineID );*/
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
let { mode } = this.props.state;
|
|
52
|
+
|
|
53
|
+
if (
|
|
54
|
+
![
|
|
55
|
+
MODE_IDLE,
|
|
56
|
+
MODE_2D_ZOOM_IN,
|
|
57
|
+
MODE_2D_ZOOM_OUT,
|
|
58
|
+
MODE_2D_PAN,
|
|
59
|
+
MODE_3D_VIEW,
|
|
60
|
+
MODE_3D_FIRST_PERSON,
|
|
61
|
+
MODE_WAITING_DRAWING_LINE,
|
|
62
|
+
MODE_DRAWING_LINE,
|
|
63
|
+
MODE_DRAWING_HOLE,
|
|
64
|
+
MODE_DRAWING_ITEM,
|
|
65
|
+
MODE_DRAGGING_LINE,
|
|
66
|
+
MODE_DRAGGING_VERTEX,
|
|
67
|
+
MODE_DRAGGING_ITEM,
|
|
68
|
+
MODE_DRAGGING_HOLE,
|
|
69
|
+
MODE_ROTATING_ITEM,
|
|
70
|
+
MODE_UPLOADING_IMAGE,
|
|
71
|
+
MODE_FITTING_IMAGE
|
|
72
|
+
].includes(mode)
|
|
73
|
+
)
|
|
74
|
+
return null;
|
|
75
|
+
|
|
76
|
+
let groups = this.props.state.getIn(['scene', 'groups']);
|
|
77
|
+
|
|
78
|
+
//TODO change in multi-layer check
|
|
79
|
+
let selectedLayer = this.props.state.getIn(['scene', 'selectedLayer']);
|
|
80
|
+
let selecteds = this.props.state.getIn([
|
|
81
|
+
'scene',
|
|
82
|
+
'layers',
|
|
83
|
+
selectedLayer,
|
|
84
|
+
'selected'
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Panel name={'Multiselected'} opened={true}>
|
|
89
|
+
<div style={{ padding: '5px 15px' }}>
|
|
90
|
+
<p>Multiselection tab</p>
|
|
91
|
+
<table style={tableStyle}>
|
|
92
|
+
<tbody>
|
|
93
|
+
<tr>
|
|
94
|
+
<td style={firstTdStyle}>Add to Group</td>
|
|
95
|
+
<td>
|
|
96
|
+
<FormSelect
|
|
97
|
+
value={this.state.selectedGroupID}
|
|
98
|
+
onChange={e =>
|
|
99
|
+
this.setState({ selectedGroupID: e.target.value })
|
|
100
|
+
}
|
|
101
|
+
>
|
|
102
|
+
<option key={0} value={''}></option>
|
|
103
|
+
{groups.entrySeq().map(([groupID, group]) => (
|
|
104
|
+
<option key={groupID} value={groupID}>
|
|
105
|
+
{group.get('name')}
|
|
106
|
+
</option>
|
|
107
|
+
))}
|
|
108
|
+
</FormSelect>
|
|
109
|
+
</td>
|
|
110
|
+
<td
|
|
111
|
+
style={{
|
|
112
|
+
cursor: 'pointer',
|
|
113
|
+
padding: '0.5em 0',
|
|
114
|
+
textAlign: 'center'
|
|
115
|
+
}}
|
|
116
|
+
onClick={e => {
|
|
117
|
+
if (
|
|
118
|
+
!this.state.selectedGroupID ||
|
|
119
|
+
this.state.selectedGroupID === '' ||
|
|
120
|
+
!selecteds ||
|
|
121
|
+
!selecteds.size
|
|
122
|
+
)
|
|
123
|
+
return;
|
|
124
|
+
|
|
125
|
+
let selectedJs = selecteds.toJS();
|
|
126
|
+
|
|
127
|
+
for (let x = 0; x < selectedJs.lines.length; x++)
|
|
128
|
+
this.context.groupsActions.addToGroup(
|
|
129
|
+
this.state.selectedGroupID,
|
|
130
|
+
selectedLayer,
|
|
131
|
+
'lines',
|
|
132
|
+
selectedJs.lines[x]
|
|
133
|
+
);
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
+
|
|
137
|
+
</td>
|
|
138
|
+
</tr>
|
|
139
|
+
</tbody>
|
|
140
|
+
</table>
|
|
141
|
+
</div>
|
|
142
|
+
</Panel>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
PanelMultiElementsEditor.propTypes = {
|
|
148
|
+
state: PropTypes.object.isRequired
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
PanelMultiElementsEditor.contextTypes = {
|
|
152
|
+
projectActions: PropTypes.object.isRequired,
|
|
153
|
+
groupsActions: PropTypes.object.isRequired,
|
|
154
|
+
translator: PropTypes.object.isRequired
|
|
155
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Panel from './panel';
|
|
4
|
+
import * as SharedStyle from '../../shared-style';
|
|
5
|
+
import { FormNumberInput, FormTextInput } from '../style/export';
|
|
6
|
+
import { Map } from 'immutable';
|
|
7
|
+
|
|
8
|
+
import { FaUnlink } from 'react-icons/fa';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
MODE_IDLE,
|
|
12
|
+
MODE_2D_ZOOM_IN,
|
|
13
|
+
MODE_2D_ZOOM_OUT,
|
|
14
|
+
MODE_2D_PAN,
|
|
15
|
+
MODE_3D_VIEW,
|
|
16
|
+
MODE_3D_FIRST_PERSON,
|
|
17
|
+
MODE_WAITING_DRAWING_LINE,
|
|
18
|
+
MODE_DRAWING_LINE,
|
|
19
|
+
MODE_DRAWING_HOLE,
|
|
20
|
+
MODE_DRAWING_ITEM,
|
|
21
|
+
MODE_DRAGGING_LINE,
|
|
22
|
+
MODE_DRAGGING_VERTEX,
|
|
23
|
+
MODE_DRAGGING_ITEM,
|
|
24
|
+
MODE_DRAGGING_HOLE,
|
|
25
|
+
MODE_FITTING_IMAGE,
|
|
26
|
+
MODE_UPLOADING_IMAGE,
|
|
27
|
+
MODE_ROTATING_ITEM,
|
|
28
|
+
MODE_IDLE_3D,
|
|
29
|
+
MODE_DRAGGING_ITEM_3D,
|
|
30
|
+
MODE_ROTATING_ITEM_3D
|
|
31
|
+
} from '../../constants';
|
|
32
|
+
|
|
33
|
+
const VISIBILITY_MODE = {
|
|
34
|
+
MODE_IDLE,
|
|
35
|
+
MODE_2D_ZOOM_IN,
|
|
36
|
+
MODE_2D_ZOOM_OUT,
|
|
37
|
+
MODE_2D_PAN,
|
|
38
|
+
MODE_3D_VIEW,
|
|
39
|
+
MODE_3D_FIRST_PERSON,
|
|
40
|
+
MODE_WAITING_DRAWING_LINE,
|
|
41
|
+
MODE_DRAWING_LINE,
|
|
42
|
+
MODE_DRAWING_HOLE,
|
|
43
|
+
MODE_DRAWING_ITEM,
|
|
44
|
+
MODE_DRAGGING_LINE,
|
|
45
|
+
MODE_DRAGGING_VERTEX,
|
|
46
|
+
MODE_DRAGGING_ITEM,
|
|
47
|
+
MODE_DRAGGING_HOLE,
|
|
48
|
+
MODE_FITTING_IMAGE,
|
|
49
|
+
MODE_UPLOADING_IMAGE,
|
|
50
|
+
MODE_ROTATING_ITEM,
|
|
51
|
+
MODE_IDLE_3D,
|
|
52
|
+
MODE_DRAGGING_ITEM_3D,
|
|
53
|
+
MODE_ROTATING_ITEM_3D
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const tableStyle = { width: '100%' };
|
|
57
|
+
const firstTdStyle = { width: '6em' };
|
|
58
|
+
const inputStyle = { textAlign: 'left' };
|
|
59
|
+
const styleEditButton = {
|
|
60
|
+
marginLeft: '5px',
|
|
61
|
+
border: '0px',
|
|
62
|
+
background: 'none',
|
|
63
|
+
color: SharedStyle.COLORS.white,
|
|
64
|
+
fontSize: '14px',
|
|
65
|
+
outline: '0px'
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const tablegroupStyle = {
|
|
69
|
+
width: '100%',
|
|
70
|
+
cursor: 'pointer',
|
|
71
|
+
maxHeight: '20em',
|
|
72
|
+
marginLeft: '1px',
|
|
73
|
+
marginTop: '1em'
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const iconColStyle = { width: '2em' };
|
|
77
|
+
|
|
78
|
+
export default class PanelGroupEditor extends Component {
|
|
79
|
+
constructor(props, context) {
|
|
80
|
+
super(props, context);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
shouldComponentUpdate(nextProps, nextState) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
componentWillReceiveProps(nextProps, nextContext) {}
|
|
88
|
+
|
|
89
|
+
render() {
|
|
90
|
+
if (!this.props.groupID || !VISIBILITY_MODE[this.props.state.mode])
|
|
91
|
+
return null;
|
|
92
|
+
|
|
93
|
+
let group = this.props.state.getIn(['scene', 'groups', this.props.groupID]);
|
|
94
|
+
let elements = group.get('elements');
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Panel
|
|
98
|
+
name={this.context.translator.t('Group [{0}]', group.get('name'))}
|
|
99
|
+
opened={true}
|
|
100
|
+
>
|
|
101
|
+
<div style={{ padding: '5px 15px' }}>
|
|
102
|
+
<table style={tableStyle}>
|
|
103
|
+
<tbody>
|
|
104
|
+
<tr>
|
|
105
|
+
<td style={firstTdStyle}>
|
|
106
|
+
{this.context.translator.t('Name')}
|
|
107
|
+
</td>
|
|
108
|
+
<td>
|
|
109
|
+
<FormTextInput
|
|
110
|
+
value={group.get('name')}
|
|
111
|
+
onChange={e =>
|
|
112
|
+
this.context.groupsActions.setGroupAttributes(
|
|
113
|
+
this.props.groupID,
|
|
114
|
+
new Map({ name: e.target.value })
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
style={inputStyle}
|
|
118
|
+
/>
|
|
119
|
+
</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td style={firstTdStyle}>X</td>
|
|
123
|
+
<td>
|
|
124
|
+
<FormNumberInput
|
|
125
|
+
value={group.get('x')}
|
|
126
|
+
onChange={e =>
|
|
127
|
+
this.context.groupsActions.groupTranslate(
|
|
128
|
+
this.props.groupID,
|
|
129
|
+
e.target.value,
|
|
130
|
+
group.get('y')
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
style={inputStyle}
|
|
134
|
+
state={this.props.state}
|
|
135
|
+
precision={2}
|
|
136
|
+
/>
|
|
137
|
+
</td>
|
|
138
|
+
</tr>
|
|
139
|
+
<tr>
|
|
140
|
+
<td style={firstTdStyle}>Y</td>
|
|
141
|
+
<td>
|
|
142
|
+
<FormNumberInput
|
|
143
|
+
value={group.get('y')}
|
|
144
|
+
onChange={e =>
|
|
145
|
+
this.context.groupsActions.groupTranslate(
|
|
146
|
+
this.props.groupID,
|
|
147
|
+
group.get('x'),
|
|
148
|
+
e.target.value
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
style={inputStyle}
|
|
152
|
+
state={this.props.state}
|
|
153
|
+
precision={2}
|
|
154
|
+
/>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
<tr>
|
|
158
|
+
<td style={firstTdStyle}>
|
|
159
|
+
{this.context.translator.t('Rotation')}
|
|
160
|
+
</td>
|
|
161
|
+
<td>
|
|
162
|
+
<FormNumberInput
|
|
163
|
+
value={group.get('rotation')}
|
|
164
|
+
onChange={e =>
|
|
165
|
+
this.context.groupsActions.groupRotate(
|
|
166
|
+
this.props.groupID,
|
|
167
|
+
e.target.value
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
style={inputStyle}
|
|
171
|
+
state={this.props.state}
|
|
172
|
+
precision={2}
|
|
173
|
+
/>
|
|
174
|
+
</td>
|
|
175
|
+
</tr>
|
|
176
|
+
</tbody>
|
|
177
|
+
</table>
|
|
178
|
+
{elements.size ? (
|
|
179
|
+
<div>
|
|
180
|
+
<p
|
|
181
|
+
style={{
|
|
182
|
+
textAlign: 'center',
|
|
183
|
+
borderBottom: SharedStyle.PRIMARY_COLOR.border,
|
|
184
|
+
paddingBottom: '1em'
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
{this.context.translator.t("Group's Elements")}
|
|
188
|
+
</p>
|
|
189
|
+
<table style={tablegroupStyle}>
|
|
190
|
+
<thead>
|
|
191
|
+
<tr>
|
|
192
|
+
<th style={iconColStyle}></th>
|
|
193
|
+
<th>{this.context.translator.t('Layer')}</th>
|
|
194
|
+
<th>{this.context.translator.t('Prototype')}</th>
|
|
195
|
+
<th>{this.context.translator.t('Name')}</th>
|
|
196
|
+
</tr>
|
|
197
|
+
</thead>
|
|
198
|
+
<tbody>
|
|
199
|
+
{elements.entrySeq().map(([layerID, layerElements]) => {
|
|
200
|
+
return layerElements
|
|
201
|
+
.entrySeq()
|
|
202
|
+
.map(([elementPrototype, ElementList]) => {
|
|
203
|
+
return ElementList.valueSeq().map(elementID => {
|
|
204
|
+
let element = this.props.state.getIn([
|
|
205
|
+
'scene',
|
|
206
|
+
'layers',
|
|
207
|
+
layerID,
|
|
208
|
+
elementPrototype,
|
|
209
|
+
elementID
|
|
210
|
+
]);
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<tr key={elementID}>
|
|
214
|
+
<td
|
|
215
|
+
style={iconColStyle}
|
|
216
|
+
title={this.context.translator.t(
|
|
217
|
+
'Un-chain Element from Group'
|
|
218
|
+
)}
|
|
219
|
+
>
|
|
220
|
+
<FaUnlink
|
|
221
|
+
onClick={e =>
|
|
222
|
+
this.context.groupsActions.removeFromGroup(
|
|
223
|
+
this.props.groupID,
|
|
224
|
+
layerID,
|
|
225
|
+
elementPrototype,
|
|
226
|
+
elementID
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
style={styleEditButton}
|
|
230
|
+
/>
|
|
231
|
+
</td>
|
|
232
|
+
<td style={{ textAlign: 'center' }}>{layerID}</td>
|
|
233
|
+
<td
|
|
234
|
+
style={{
|
|
235
|
+
textAlign: 'center',
|
|
236
|
+
textTransform: 'capitalize'
|
|
237
|
+
}}
|
|
238
|
+
>
|
|
239
|
+
{elementPrototype}
|
|
240
|
+
</td>
|
|
241
|
+
<td style={{ textAlign: 'center' }}>
|
|
242
|
+
{element.name}
|
|
243
|
+
</td>
|
|
244
|
+
</tr>
|
|
245
|
+
);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
})}
|
|
249
|
+
</tbody>
|
|
250
|
+
</table>
|
|
251
|
+
</div>
|
|
252
|
+
) : null}
|
|
253
|
+
</div>
|
|
254
|
+
</Panel>
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
PanelGroupEditor.propTypes = {
|
|
260
|
+
state: PropTypes.object.isRequired,
|
|
261
|
+
groupID: PropTypes.string
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
PanelGroupEditor.contextTypes = {
|
|
265
|
+
catalog: PropTypes.object.isRequired,
|
|
266
|
+
translator: PropTypes.object.isRequired,
|
|
267
|
+
itemsActions: PropTypes.object.isRequired,
|
|
268
|
+
linesActions: PropTypes.object.isRequired,
|
|
269
|
+
holesActions: PropTypes.object.isRequired,
|
|
270
|
+
groupsActions: PropTypes.object.isRequired,
|
|
271
|
+
projectActions: PropTypes.object.isRequired
|
|
272
|
+
};
|