kitchen-simulator 5.0.0-test.17 → 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 -18
- 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 -91
- 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/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/content.jsx +136 -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/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/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/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/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/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/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,310 @@
|
|
|
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 { TiPlus, TiDelete } from 'react-icons/ti';
|
|
6
|
+
import { FaTrash, FaEye, FaLink, FaUnlink } from 'react-icons/fa';
|
|
7
|
+
import { Map } from 'immutable';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
MODE_IDLE,
|
|
11
|
+
MODE_2D_ZOOM_IN,
|
|
12
|
+
MODE_2D_ZOOM_OUT,
|
|
13
|
+
MODE_2D_PAN,
|
|
14
|
+
MODE_3D_VIEW,
|
|
15
|
+
MODE_3D_FIRST_PERSON,
|
|
16
|
+
MODE_WAITING_DRAWING_LINE,
|
|
17
|
+
MODE_DRAWING_LINE,
|
|
18
|
+
MODE_DRAWING_HOLE,
|
|
19
|
+
MODE_DRAWING_ITEM,
|
|
20
|
+
MODE_DRAGGING_LINE,
|
|
21
|
+
MODE_DRAGGING_VERTEX,
|
|
22
|
+
MODE_DRAGGING_ITEM,
|
|
23
|
+
MODE_DRAGGING_HOLE,
|
|
24
|
+
MODE_FITTING_IMAGE,
|
|
25
|
+
MODE_UPLOADING_IMAGE,
|
|
26
|
+
MODE_ROTATING_ITEM,
|
|
27
|
+
MODE_IDLE_3D,
|
|
28
|
+
MODE_DRAGGING_ITEM_3D,
|
|
29
|
+
MODE_ROTATING_ITEM_3D
|
|
30
|
+
} from '../../constants';
|
|
31
|
+
|
|
32
|
+
const VISIBILITY_MODE = {
|
|
33
|
+
MODE_IDLE,
|
|
34
|
+
MODE_2D_ZOOM_IN,
|
|
35
|
+
MODE_2D_ZOOM_OUT,
|
|
36
|
+
MODE_2D_PAN,
|
|
37
|
+
MODE_3D_VIEW,
|
|
38
|
+
MODE_3D_FIRST_PERSON,
|
|
39
|
+
MODE_WAITING_DRAWING_LINE,
|
|
40
|
+
MODE_DRAWING_LINE,
|
|
41
|
+
MODE_DRAWING_HOLE,
|
|
42
|
+
MODE_DRAWING_ITEM,
|
|
43
|
+
MODE_DRAGGING_LINE,
|
|
44
|
+
MODE_DRAGGING_VERTEX,
|
|
45
|
+
MODE_DRAGGING_ITEM,
|
|
46
|
+
MODE_DRAGGING_HOLE,
|
|
47
|
+
MODE_FITTING_IMAGE,
|
|
48
|
+
MODE_UPLOADING_IMAGE,
|
|
49
|
+
MODE_ROTATING_ITEM,
|
|
50
|
+
MODE_IDLE_3D,
|
|
51
|
+
MODE_DRAGGING_ITEM_3D,
|
|
52
|
+
MODE_ROTATING_ITEM_3D
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const styleEditButton = {
|
|
56
|
+
marginLeft: '5px',
|
|
57
|
+
border: '0px',
|
|
58
|
+
background: 'none',
|
|
59
|
+
color: SharedStyle.COLORS.white,
|
|
60
|
+
fontSize: '14px',
|
|
61
|
+
outline: '0px'
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const tablegroupStyle = {
|
|
65
|
+
width: '100%',
|
|
66
|
+
cursor: 'pointer',
|
|
67
|
+
maxHeight: '20em',
|
|
68
|
+
padding: '0 1em',
|
|
69
|
+
marginLeft: '1px'
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const iconColStyle = { width: '2em', textAlign: 'center' };
|
|
73
|
+
const styleHoverColor = { color: SharedStyle.SECONDARY_COLOR.main };
|
|
74
|
+
const styleEditButtonHover = { ...styleEditButton, ...styleHoverColor };
|
|
75
|
+
const styleAddLabel = { fontSize: '10px', marginLeft: '5px' };
|
|
76
|
+
const styleEyeVisible = { fontSize: '1.25em' };
|
|
77
|
+
const styleEyeHidden = { ...styleEyeVisible, color: '#a5a1a1' };
|
|
78
|
+
const newLayerLableStyle = {
|
|
79
|
+
fontSize: '1.3em',
|
|
80
|
+
cursor: 'pointer',
|
|
81
|
+
textAlign: 'center'
|
|
82
|
+
};
|
|
83
|
+
const newLayerLableHoverStyle = { ...newLayerLableStyle, ...styleHoverColor };
|
|
84
|
+
|
|
85
|
+
export default class PanelGroups extends Component {
|
|
86
|
+
constructor(props, context) {
|
|
87
|
+
super(props, context);
|
|
88
|
+
|
|
89
|
+
this.state = {
|
|
90
|
+
newEmptyHover: false,
|
|
91
|
+
newSelectedHover: false
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
shouldComponentUpdate(nextProps, nextState) {
|
|
96
|
+
return (
|
|
97
|
+
this.props.groups.hashCode() !== nextProps.groups.hashCode() ||
|
|
98
|
+
this.props.layers.hashCode() !== nextProps.layers.hashCode() ||
|
|
99
|
+
this.props.mode !== nextProps.mode
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
render() {
|
|
104
|
+
let { mode, groups, layers } = this.props;
|
|
105
|
+
|
|
106
|
+
if (!VISIBILITY_MODE[mode]) return null;
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<Panel
|
|
110
|
+
name={this.context.translator.t('Groups')}
|
|
111
|
+
opened={groups.size > 0}
|
|
112
|
+
>
|
|
113
|
+
{groups.size ? (
|
|
114
|
+
<table style={tablegroupStyle}>
|
|
115
|
+
<thead>
|
|
116
|
+
<tr>
|
|
117
|
+
<th colSpan="4"></th>
|
|
118
|
+
<th>{this.context.translator.t('Elements')}</th>
|
|
119
|
+
<th>{this.context.translator.t('Name')}</th>
|
|
120
|
+
</tr>
|
|
121
|
+
</thead>
|
|
122
|
+
<tbody>
|
|
123
|
+
{groups.entrySeq().map(([groupID, group]) => {
|
|
124
|
+
let selectClick = e =>
|
|
125
|
+
this.context.groupsActions.selectGroup(groupID);
|
|
126
|
+
|
|
127
|
+
let swapVisibility = e => {
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
this.context.groupsActions.setGroupProperties(
|
|
130
|
+
groupID,
|
|
131
|
+
new Map({ visible: !group.get('visible') })
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
let chainToGroup = e => {
|
|
136
|
+
layers.forEach(layer => {
|
|
137
|
+
let layerID = layer.get('id');
|
|
138
|
+
let layerElements = {
|
|
139
|
+
lines: layer.get('lines'),
|
|
140
|
+
items: layer.get('items'),
|
|
141
|
+
holes: layer.get('holes'),
|
|
142
|
+
areas: layer.get('areas')
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
for (let elementPrototype in layerElements) {
|
|
146
|
+
let ElementList = layerElements[elementPrototype];
|
|
147
|
+
ElementList.filter(el => el.get('selected')).forEach(
|
|
148
|
+
element => {
|
|
149
|
+
this.context.groupsActions.addToGroup(
|
|
150
|
+
groupID,
|
|
151
|
+
layerID,
|
|
152
|
+
elementPrototype,
|
|
153
|
+
element.get('id')
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
selectClick(e);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
let isCurrentgroup = group.get('selected');
|
|
164
|
+
let shouldHighlight = isCurrentgroup;
|
|
165
|
+
let rowStyle = !shouldHighlight ? null : styleHoverColor;
|
|
166
|
+
|
|
167
|
+
let dimension = group.get('elements').reduce((sum, layer) => {
|
|
168
|
+
return (
|
|
169
|
+
sum + layer.reduce((lSum, elProt) => lSum + elProt.size, 0)
|
|
170
|
+
);
|
|
171
|
+
}, 0);
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<tr key={groupID} style={rowStyle}>
|
|
175
|
+
<td
|
|
176
|
+
style={iconColStyle}
|
|
177
|
+
title={this.context.translator.t(
|
|
178
|
+
'Toggle Group Visibility'
|
|
179
|
+
)}
|
|
180
|
+
>
|
|
181
|
+
<FaEye
|
|
182
|
+
onClick={swapVisibility}
|
|
183
|
+
style={
|
|
184
|
+
!group.get('visible')
|
|
185
|
+
? styleEyeHidden
|
|
186
|
+
: styleEyeVisible
|
|
187
|
+
}
|
|
188
|
+
/>
|
|
189
|
+
</td>
|
|
190
|
+
<td
|
|
191
|
+
style={iconColStyle}
|
|
192
|
+
title={this.context.translator.t(
|
|
193
|
+
'Chain selected Elements to Group'
|
|
194
|
+
)}
|
|
195
|
+
>
|
|
196
|
+
<FaLink
|
|
197
|
+
onClick={chainToGroup}
|
|
198
|
+
style={
|
|
199
|
+
!shouldHighlight
|
|
200
|
+
? styleEditButton
|
|
201
|
+
: styleEditButtonHover
|
|
202
|
+
}
|
|
203
|
+
/>
|
|
204
|
+
</td>
|
|
205
|
+
<td
|
|
206
|
+
style={iconColStyle}
|
|
207
|
+
title={this.context.translator.t(
|
|
208
|
+
"Un-chain all Group's Elements and remove Group"
|
|
209
|
+
)}
|
|
210
|
+
>
|
|
211
|
+
<FaUnlink
|
|
212
|
+
onClick={e =>
|
|
213
|
+
this.context.groupsActions.removeGroup(groupID)
|
|
214
|
+
}
|
|
215
|
+
style={
|
|
216
|
+
!shouldHighlight
|
|
217
|
+
? styleEditButton
|
|
218
|
+
: styleEditButtonHover
|
|
219
|
+
}
|
|
220
|
+
/>
|
|
221
|
+
</td>
|
|
222
|
+
<td
|
|
223
|
+
style={iconColStyle}
|
|
224
|
+
title={this.context.translator.t(
|
|
225
|
+
'Delete group and all Elements'
|
|
226
|
+
)}
|
|
227
|
+
>
|
|
228
|
+
<FaTrash
|
|
229
|
+
onClick={e =>
|
|
230
|
+
this.context.groupsActions.removeGroupAndDeleteElements(
|
|
231
|
+
groupID
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
style={
|
|
235
|
+
!shouldHighlight
|
|
236
|
+
? styleEditButton
|
|
237
|
+
: styleEditButtonHover
|
|
238
|
+
}
|
|
239
|
+
/>
|
|
240
|
+
</td>
|
|
241
|
+
<td
|
|
242
|
+
onClick={selectClick}
|
|
243
|
+
style={{ width: '0em', textAlign: 'center' }}
|
|
244
|
+
>
|
|
245
|
+
{dimension}
|
|
246
|
+
</td>
|
|
247
|
+
<td onClick={selectClick}>{group.get('name')}</td>
|
|
248
|
+
</tr>
|
|
249
|
+
);
|
|
250
|
+
})}
|
|
251
|
+
</tbody>
|
|
252
|
+
</table>
|
|
253
|
+
) : null}
|
|
254
|
+
|
|
255
|
+
<table style={{ width: '100%', marginTop: '0.1em' }}>
|
|
256
|
+
<tbody>
|
|
257
|
+
<tr>
|
|
258
|
+
<td
|
|
259
|
+
style={
|
|
260
|
+
!this.state.newEmptyHover
|
|
261
|
+
? newLayerLableStyle
|
|
262
|
+
: newLayerLableHoverStyle
|
|
263
|
+
}
|
|
264
|
+
onMouseOver={() => this.setState({ newEmptyHover: true })}
|
|
265
|
+
onMouseOut={() => this.setState({ newEmptyHover: false })}
|
|
266
|
+
onClick={e => this.context.groupsActions.addGroup()}
|
|
267
|
+
>
|
|
268
|
+
<TiPlus />
|
|
269
|
+
<b style={styleAddLabel}>
|
|
270
|
+
{this.context.translator.t('New Empty Group')}
|
|
271
|
+
</b>
|
|
272
|
+
</td>
|
|
273
|
+
<td
|
|
274
|
+
style={
|
|
275
|
+
!this.state.newSelectedHover
|
|
276
|
+
? newLayerLableStyle
|
|
277
|
+
: newLayerLableHoverStyle
|
|
278
|
+
}
|
|
279
|
+
onMouseOver={() => this.setState({ newSelectedHover: true })}
|
|
280
|
+
onMouseOut={() => this.setState({ newSelectedHover: false })}
|
|
281
|
+
onClick={e => this.context.groupsActions.addGroupFromSelected()}
|
|
282
|
+
>
|
|
283
|
+
<TiPlus />
|
|
284
|
+
<b style={styleAddLabel}>
|
|
285
|
+
{this.context.translator.t('New Group from selected')}
|
|
286
|
+
</b>
|
|
287
|
+
</td>
|
|
288
|
+
</tr>
|
|
289
|
+
</tbody>
|
|
290
|
+
</table>
|
|
291
|
+
</Panel>
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
PanelGroups.propTypes = {
|
|
297
|
+
mode: PropTypes.string.isRequired,
|
|
298
|
+
groups: PropTypes.object.isRequired,
|
|
299
|
+
layers: PropTypes.object.isRequired
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
PanelGroups.contextTypes = {
|
|
303
|
+
catalog: PropTypes.object.isRequired,
|
|
304
|
+
translator: PropTypes.object.isRequired,
|
|
305
|
+
itemsActions: PropTypes.object.isRequired,
|
|
306
|
+
linesActions: PropTypes.object.isRequired,
|
|
307
|
+
holesActions: PropTypes.object.isRequired,
|
|
308
|
+
groupsActions: PropTypes.object.isRequired,
|
|
309
|
+
projectActions: PropTypes.object.isRequired
|
|
310
|
+
};
|
|
@@ -0,0 +1,192 @@
|
|
|
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 { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
|
|
6
|
+
import { FaPencil, FaTrash, FaTimes } from 'react-icons/fa';
|
|
7
|
+
import { FormNumberInput } from '../../components/style/export';
|
|
8
|
+
|
|
9
|
+
const tabStyle = { margin: '1em' };
|
|
10
|
+
|
|
11
|
+
const iconStyle = {
|
|
12
|
+
fontSize: '14px',
|
|
13
|
+
margin: '2px',
|
|
14
|
+
cursor: 'pointer'
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const addGuideStyle = {
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
height: '2em'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const tableTabStyle = {
|
|
23
|
+
width: '100%',
|
|
24
|
+
textAlign: 'center'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default class PanelGuides extends Component {
|
|
28
|
+
constructor(props, context) {
|
|
29
|
+
super(props, context);
|
|
30
|
+
|
|
31
|
+
this.state = {
|
|
32
|
+
addHGVisible: true,
|
|
33
|
+
addVGVisible: true,
|
|
34
|
+
addCGVisible: true
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
shouldComponentUpdate(nextProps, nextState) {
|
|
39
|
+
return (
|
|
40
|
+
this.state.addHGVisible !== nextState.addHGVisible ||
|
|
41
|
+
this.state.addVGVisible !== nextState.addVGVisible ||
|
|
42
|
+
this.state.addCGVisible !== nextState.addCGVisible ||
|
|
43
|
+
this.props.state.getIn(['scene', 'guides']).hashCode() !==
|
|
44
|
+
nextProps.state.getIn(['scene', 'guides']).hashCode()
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
render() {
|
|
49
|
+
let { state } = this.props;
|
|
50
|
+
let { projectActions, translator } = this.context;
|
|
51
|
+
let { guides } = state.scene;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Panel name={translator.t('Guides')}>
|
|
55
|
+
<Tabs id="guidesTabs" style={tabStyle}>
|
|
56
|
+
<TabList>
|
|
57
|
+
<Tab>{translator.t('Horizontal')}</Tab>
|
|
58
|
+
<Tab>{translator.t('Vertical')}</Tab>
|
|
59
|
+
{/*<Tab>{translator.t('Circular')}</Tab>*/}
|
|
60
|
+
</TabList>
|
|
61
|
+
|
|
62
|
+
<TabPanel>
|
|
63
|
+
<table style={tableTabStyle}>
|
|
64
|
+
<tbody>
|
|
65
|
+
{guides
|
|
66
|
+
.get('horizontal')
|
|
67
|
+
.entrySeq()
|
|
68
|
+
.map(([hgKey, hgVal], ind) => {
|
|
69
|
+
return (
|
|
70
|
+
<tr key={hgKey}>
|
|
71
|
+
<td style={{ width: '2em' }}>{ind + 1}</td>
|
|
72
|
+
<td>{hgVal}</td>
|
|
73
|
+
<td style={{ width: '5em' }}>
|
|
74
|
+
{/*<FaPencil style={iconStyle} />*/}
|
|
75
|
+
<FaTrash
|
|
76
|
+
style={iconStyle}
|
|
77
|
+
onClick={e =>
|
|
78
|
+
projectActions.removeHorizontalGuide(hgKey)
|
|
79
|
+
}
|
|
80
|
+
/>
|
|
81
|
+
</td>
|
|
82
|
+
</tr>
|
|
83
|
+
);
|
|
84
|
+
})}
|
|
85
|
+
{this.state.addHGVisible ? (
|
|
86
|
+
<tr>
|
|
87
|
+
<td
|
|
88
|
+
colSpan="3"
|
|
89
|
+
style={addGuideStyle}
|
|
90
|
+
onClick={e => this.setState({ addHGVisible: false })}
|
|
91
|
+
>
|
|
92
|
+
{translator.t('+ Add Horizontal Giude')}
|
|
93
|
+
</td>
|
|
94
|
+
</tr>
|
|
95
|
+
) : (
|
|
96
|
+
<tr>
|
|
97
|
+
<td colSpan="2">
|
|
98
|
+
<FormNumberInput
|
|
99
|
+
value={0}
|
|
100
|
+
onChange={e => {
|
|
101
|
+
projectActions.addHorizontalGuide(e.target.value);
|
|
102
|
+
return this.setState({ addHGVisible: true });
|
|
103
|
+
}}
|
|
104
|
+
min={0}
|
|
105
|
+
max={this.props.state.getIn(['scene', 'height'])}
|
|
106
|
+
/>
|
|
107
|
+
</td>
|
|
108
|
+
<td>
|
|
109
|
+
<FaTimes
|
|
110
|
+
style={iconStyle}
|
|
111
|
+
onClick={e => this.setState({ addHGVisible: true })}
|
|
112
|
+
/>
|
|
113
|
+
</td>
|
|
114
|
+
</tr>
|
|
115
|
+
)}
|
|
116
|
+
</tbody>
|
|
117
|
+
</table>
|
|
118
|
+
</TabPanel>
|
|
119
|
+
<TabPanel>
|
|
120
|
+
<table style={tableTabStyle}>
|
|
121
|
+
<tbody>
|
|
122
|
+
{guides
|
|
123
|
+
.get('vertical')
|
|
124
|
+
.entrySeq()
|
|
125
|
+
.map(([hgKey, hgVal], ind) => {
|
|
126
|
+
return (
|
|
127
|
+
<tr key={hgKey}>
|
|
128
|
+
<td style={{ width: '2em' }}>{ind + 1}</td>
|
|
129
|
+
<td>{hgVal}</td>
|
|
130
|
+
<td style={{ width: '5em' }}>
|
|
131
|
+
{/*<FaPencil style={iconStyle} />*/}
|
|
132
|
+
<FaTrash
|
|
133
|
+
style={iconStyle}
|
|
134
|
+
onClick={e =>
|
|
135
|
+
projectActions.removeVerticalGuide(hgKey)
|
|
136
|
+
}
|
|
137
|
+
/>
|
|
138
|
+
</td>
|
|
139
|
+
</tr>
|
|
140
|
+
);
|
|
141
|
+
})}
|
|
142
|
+
{this.state.addVGVisible ? (
|
|
143
|
+
<tr>
|
|
144
|
+
<td
|
|
145
|
+
colSpan="3"
|
|
146
|
+
style={addGuideStyle}
|
|
147
|
+
onClick={e => this.setState({ addVGVisible: false })}
|
|
148
|
+
>
|
|
149
|
+
{translator.t('+ Add Vertical Giude')}
|
|
150
|
+
</td>
|
|
151
|
+
</tr>
|
|
152
|
+
) : (
|
|
153
|
+
<tr>
|
|
154
|
+
<td colSpan="2">
|
|
155
|
+
<FormNumberInput
|
|
156
|
+
value={0}
|
|
157
|
+
onChange={e => {
|
|
158
|
+
projectActions.addVerticalGuide(e.target.value);
|
|
159
|
+
return this.setState({ addVGVisible: true });
|
|
160
|
+
}}
|
|
161
|
+
min={0}
|
|
162
|
+
max={this.props.state.getIn(['scene', 'height'])}
|
|
163
|
+
/>
|
|
164
|
+
</td>
|
|
165
|
+
<td>
|
|
166
|
+
<FaTimes
|
|
167
|
+
style={iconStyle}
|
|
168
|
+
onClick={e => this.setState({ addVGVisible: true })}
|
|
169
|
+
/>
|
|
170
|
+
</td>
|
|
171
|
+
</tr>
|
|
172
|
+
)}
|
|
173
|
+
</tbody>
|
|
174
|
+
</table>
|
|
175
|
+
</TabPanel>
|
|
176
|
+
{/*<TabPanel>
|
|
177
|
+
<b>TODO Circular Giudes</b>
|
|
178
|
+
</TabPanel>*/}
|
|
179
|
+
</Tabs>
|
|
180
|
+
</Panel>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
PanelGuides.propTypes = {
|
|
186
|
+
state: PropTypes.object.isRequired
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
PanelGuides.contextTypes = {
|
|
190
|
+
translator: PropTypes.object.isRequired,
|
|
191
|
+
projectActions: PropTypes.object.isRequired
|
|
192
|
+
};
|