kitchen-simulator 1.1.1-test.72 → 1.1.1-test.73
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/es/@history.js +2 -5
- package/es/AppContext.js +3 -6
- package/es/KitchenConfigurator.js +86 -86
- package/es/KitchenConfiguratorApp.js +134 -128
- package/es/actions/area-actions.js +5 -8
- package/es/actions/export.js +12 -24
- package/es/actions/groups-actions.js +27 -41
- package/es/actions/holes-actions.js +34 -51
- package/es/actions/items-actions.js +94 -141
- package/es/actions/lines-actions.js +21 -32
- package/es/actions/project-actions.js +94 -141
- package/es/actions/scene-actions.js +11 -17
- package/es/actions/vertices-actions.js +7 -11
- package/es/actions/viewer2d-actions.js +21 -32
- package/es/actions/viewer3d-actions.js +9 -14
- package/es/catalog/areas/area/planner-element.js +2 -5
- package/es/catalog/catalog.js +15 -17
- package/es/catalog/factories/area-factory-3d.js +22 -26
- package/es/catalog/factories/area-factory.js +13 -15
- package/es/catalog/factories/export.js +6 -10
- package/es/catalog/factories/wall-factory-3d.js +31 -36
- package/es/catalog/factories/wall-factory.js +21 -26
- package/es/catalog/holes/door-closet/planner-element.js +15 -19
- package/es/catalog/holes/door-double/planner-element.js +15 -19
- package/es/catalog/holes/door-exterior/planner-element.js +16 -20
- package/es/catalog/holes/door-interior/planner-element.js +16 -20
- package/es/catalog/holes/door-panic/planner-element.js +7 -11
- package/es/catalog/holes/door-panic-double/planner-element.js +15 -19
- package/es/catalog/holes/door-sliding/planner-element.js +17 -21
- package/es/catalog/holes/doorway-framed/planner-element.js +11 -15
- package/es/catalog/holes/doorway-frameless/planner-element.js +7 -11
- package/es/catalog/holes/export.js +13 -29
- package/es/catalog/holes/window-clear/planner-element.js +10 -14
- package/es/catalog/holes/window-cross/planner-element.js +10 -14
- package/es/catalog/holes/window-double-hung/planner-element.js +10 -14
- package/es/catalog/holes/window-vertical/planner-element.js +10 -14
- package/es/catalog/lines/wall/planner-element.js +2 -5
- package/es/catalog/molding/molding-dcm/planner-element.js +5 -9
- package/es/catalog/molding/molding-fbm/planner-element.js +5 -9
- package/es/catalog/molding/molding-lrm/planner-element.js +5 -9
- package/es/catalog/properties/export.js +20 -31
- package/es/catalog/properties/property-checkbox.js +28 -29
- package/es/catalog/properties/property-color.js +16 -19
- package/es/catalog/properties/property-enum.js +24 -27
- package/es/catalog/properties/property-hidden.js +9 -12
- package/es/catalog/properties/property-lenght-measure.js +38 -41
- package/es/catalog/properties/property-length-measure.js +36 -39
- package/es/catalog/properties/property-length-measure_hole.js +38 -41
- package/es/catalog/properties/property-number.js +17 -20
- package/es/catalog/properties/property-read-only.js +16 -19
- package/es/catalog/properties/property-string.js +16 -19
- package/es/catalog/properties/property-toggle.js +16 -19
- package/es/catalog/properties/shared-property-style.js +1 -3
- package/es/catalog/utils/FuseUtils.js +12 -13
- package/es/catalog/utils/exporter.js +10 -11
- package/es/catalog/utils/geom-utils.js +13 -24
- package/es/catalog/utils/item-loader.js +86 -92
- package/es/catalog/utils/load-obj.js +20 -24
- package/es/catalog/utils/mtl-loader.js +3 -4
- package/es/catalog/utils/obj-loader.js +3 -4
- package/es/class/FuseUtils.js +12 -13
- package/es/class/area.js +24 -24
- package/es/class/export.js +23 -36
- package/es/class/group.js +53 -55
- package/es/class/guide.js +15 -17
- package/es/class/hole.js +83 -85
- package/es/class/item.js +155 -155
- package/es/class/layer.js +59 -61
- package/es/class/line.js +135 -138
- package/es/class/project.js +93 -94
- package/es/class/vertex.js +29 -31
- package/es/components/content.js +19 -23
- package/es/components/disclaimer/disclaimer.js +10 -13
- package/es/components/export.js +8 -13
- package/es/components/style/button.js +25 -25
- package/es/components/style/cancel-button.js +7 -10
- package/es/components/style/content-container.js +11 -12
- package/es/components/style/content-title.js +13 -15
- package/es/components/style/delete-button.js +8 -12
- package/es/components/style/export.js +30 -46
- package/es/components/style/form-block.js +10 -11
- package/es/components/style/form-color-input.js +7 -10
- package/es/components/style/form-label.js +10 -11
- package/es/components/style/form-number-input.js +45 -43
- package/es/components/style/form-number-input_2.js +41 -39
- package/es/components/style/form-select.js +19 -20
- package/es/components/style/form-slider.js +10 -13
- package/es/components/style/form-submit-button.js +8 -12
- package/es/components/style/form-text-input.js +30 -28
- package/es/components/viewer2d/area.js +17 -20
- package/es/components/viewer2d/export.js +30 -46
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-streak.js +10 -13
- package/es/components/viewer2d/grids/grid-vertical-streak.js +10 -13
- package/es/components/viewer2d/grids/grids.js +10 -14
- package/es/components/viewer2d/group.js +15 -19
- package/es/components/viewer2d/item.js +61 -65
- package/es/components/viewer2d/layer.js +23 -26
- package/es/components/viewer2d/line.js +101 -106
- package/es/components/viewer2d/ruler.js +22 -25
- package/es/components/viewer2d/rulerDist.js +21 -24
- package/es/components/viewer2d/rulerX.js +46 -44
- package/es/components/viewer2d/rulerY.js +44 -42
- package/es/components/viewer2d/scene.js +34 -34
- package/es/components/viewer2d/snap.js +13 -17
- package/es/components/viewer2d/state.js +18 -22
- package/es/components/viewer2d/utils.js +24 -33
- package/es/components/viewer2d/vertex.js +8 -12
- package/es/components/viewer2d/viewer2d.js +156 -159
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +21 -19
- package/es/components/viewer3d/dcm.js +1 -3
- package/es/components/viewer3d/fbm.js +1 -3
- package/es/components/viewer3d/front3D.js +12 -16
- package/es/components/viewer3d/grid-creator.js +8 -12
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +6 -9
- package/es/components/viewer3d/grids/grid-streak.js +5 -8
- package/es/components/viewer3d/grids/grid-vertical-streak.js +6 -9
- package/es/components/viewer3d/libs/first-person-controls.js +2 -5
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1 -3
- package/es/components/viewer3d/libs/mtl-loader.js +1 -3
- package/es/components/viewer3d/libs/obj-loader.js +1 -3
- package/es/components/viewer3d/libs/orbit-controls.js +2 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +2 -4
- package/es/components/viewer3d/lrm.js +1 -3
- package/es/components/viewer3d/model.js +1 -3
- package/es/components/viewer3d/pointer-lock-navigation.js +3 -6
- package/es/components/viewer3d/ruler-utils/itemRect.js +18 -21
- package/es/components/viewer3d/ruler-utils/layer3D.js +59 -62
- package/es/components/viewer3d/ruler-utils/ruler3D.js +42 -43
- package/es/components/viewer3d/ruler-utils/scene3D.js +9 -13
- package/es/components/viewer3d/ruler-utils/state3D.js +4 -7
- package/es/components/viewer3d/scene-creator.js +197 -223
- package/es/components/viewer3d/three-memory-cleaner.js +3 -7
- package/es/components/viewer3d/viewer3d-first-person.js +42 -42
- package/es/components/viewer3d/viewer3d.js +200 -198
- package/es/constants.js +349 -354
- package/es/index.js +7 -11
- package/es/models.js +193 -191
- package/es/plugins/SVGLoader.js +48 -49
- package/es/plugins/autosave.js +3 -5
- package/es/plugins/console-debugger.js +6 -7
- package/es/plugins/export.js +8 -13
- package/es/plugins/keyboard.js +29 -31
- package/es/reducers/areas-reducer.js +7 -9
- package/es/reducers/export.js +24 -37
- package/es/reducers/groups-reducer.js +31 -33
- package/es/reducers/holes-reducer.js +43 -45
- package/es/reducers/items-reducer.js +106 -108
- package/es/reducers/lines-reducer.js +28 -30
- package/es/reducers/project-reducer.js +105 -107
- package/es/reducers/reducer.js +16 -19
- package/es/reducers/scene-reducer.js +15 -17
- package/es/reducers/user-reducer.js +5 -7
- package/es/reducers/vertices-reducer.js +11 -13
- package/es/reducers/viewer2d-reducer.js +18 -20
- package/es/reducers/viewer3d-reducer.js +16 -18
- package/es/shared-style.js +10 -12
- package/es/styles/export.js +3 -6
- package/es/translator/en.js +1 -3
- package/es/translator/it.js +1 -3
- package/es/translator/ru.js +1 -3
- package/es/translator/translator.js +13 -15
- package/es/utils/browser.js +2 -5
- package/es/utils/convert-units-lite.js +1 -3
- package/es/utils/email-validator.js +1 -3
- package/es/utils/export.js +15 -29
- package/es/utils/geometry.js +190 -280
- package/es/utils/get-edges-of-subgraphs.js +2 -5
- package/es/utils/graph-cycles.js +8 -7
- package/es/utils/graph-inner-cycles.js +10 -14
- package/es/utils/graph.js +9 -13
- package/es/utils/helper.js +41 -58
- package/es/utils/history.js +8 -11
- package/es/utils/id-broker.js +8 -11
- package/es/utils/logger.js +1 -3
- package/es/utils/math.js +5 -8
- package/es/utils/molding.js +130 -146
- package/es/utils/name-generator.js +7 -9
- package/es/utils/objects-utils.js +7 -14
- package/es/utils/phone-validator.js +1 -3
- package/es/utils/process-black-list.js +5 -6
- package/es/utils/react-if.js +7 -9
- package/es/utils/snap-scene.js +27 -30
- package/es/utils/snap.js +53 -57
- package/es/utils/summarizeCart.js +1 -3
- package/es/utils/threeCSG.es6.js +13 -17
- package/es/version.js +1 -3
- package/package.json +1 -1
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _export = require("../../components/style/export");
|
|
7
|
-
var _sharedPropertyStyle = _interopRequireDefault(require("./shared-property-style"));
|
|
8
|
-
function PropertyColor(_ref) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormLabel, FormColorInput } from "../../components/style/export";
|
|
4
|
+
import PropertyStyle from "./shared-property-style";
|
|
5
|
+
export default function PropertyColor(_ref) {
|
|
9
6
|
var value = _ref.value,
|
|
10
7
|
onUpdate = _ref.onUpdate,
|
|
11
8
|
configs = _ref.configs,
|
|
@@ -20,12 +17,12 @@ function PropertyColor(_ref) {
|
|
|
20
17
|
}
|
|
21
18
|
return onUpdate(val);
|
|
22
19
|
};
|
|
23
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
24
21
|
className: "PropertyColor",
|
|
25
|
-
style:
|
|
26
|
-
}, /*#__PURE__*/
|
|
27
|
-
style:
|
|
28
|
-
}, /*#__PURE__*/
|
|
22
|
+
style: PropertyStyle.tableStyle
|
|
23
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
24
|
+
style: PropertyStyle.firstTdStyle
|
|
25
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, configs.label)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(FormColorInput, {
|
|
29
26
|
value: value,
|
|
30
27
|
onChange: function onChange(event) {
|
|
31
28
|
return update(event.target.value);
|
|
@@ -33,10 +30,10 @@ function PropertyColor(_ref) {
|
|
|
33
30
|
})))));
|
|
34
31
|
}
|
|
35
32
|
PropertyColor.propTypes = {
|
|
36
|
-
value:
|
|
37
|
-
onUpdate:
|
|
38
|
-
configs:
|
|
39
|
-
sourceElement:
|
|
40
|
-
internalState:
|
|
41
|
-
state:
|
|
33
|
+
value: PropTypes.any.isRequired,
|
|
34
|
+
onUpdate: PropTypes.func.isRequired,
|
|
35
|
+
configs: PropTypes.object.isRequired,
|
|
36
|
+
sourceElement: PropTypes.object,
|
|
37
|
+
internalState: PropTypes.object,
|
|
38
|
+
state: PropTypes.object.isRequired
|
|
42
39
|
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _immutable = require("immutable");
|
|
8
|
-
var _export = require("../../components/style/export");
|
|
9
|
-
var _constants = require("../../constants");
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Seq } from 'immutable';
|
|
5
|
+
import { FormSelect } from "../../components/style/export";
|
|
6
|
+
import { DEFAULT_FONT_FAMILY, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
|
|
10
7
|
var styles = {
|
|
11
8
|
enumWrapper: {
|
|
12
9
|
display: 'flex',
|
|
@@ -17,8 +14,8 @@ var styles = {
|
|
|
17
14
|
return {
|
|
18
15
|
marginRight: 'auto',
|
|
19
16
|
width: 110,
|
|
20
|
-
color:
|
|
21
|
-
fontFamily:
|
|
17
|
+
color: TEXT_COLOR_NEUTRAL_0,
|
|
18
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
22
19
|
fontSize: fontSize,
|
|
23
20
|
fontWeight: 400,
|
|
24
21
|
lineHeight: '15px',
|
|
@@ -38,7 +35,7 @@ function getFontSize() {
|
|
|
38
35
|
}
|
|
39
36
|
return 13;
|
|
40
37
|
}
|
|
41
|
-
function PropertyEnum(_ref) {
|
|
38
|
+
export default function PropertyEnum(_ref) {
|
|
42
39
|
var value = _ref.value,
|
|
43
40
|
onUpdate = _ref.onUpdate,
|
|
44
41
|
configs = _ref.configs,
|
|
@@ -53,11 +50,11 @@ function PropertyEnum(_ref) {
|
|
|
53
50
|
}
|
|
54
51
|
return onUpdate(val);
|
|
55
52
|
};
|
|
56
|
-
var _React$useState =
|
|
57
|
-
_React$useState2 = (
|
|
53
|
+
var _React$useState = React.useState(getFontSize()),
|
|
54
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
58
55
|
fontSize = _React$useState2[0],
|
|
59
56
|
setFontSize = _React$useState2[1];
|
|
60
|
-
|
|
57
|
+
React.useEffect(function () {
|
|
61
58
|
function handleResize() {
|
|
62
59
|
setFontSize(getFontSize());
|
|
63
60
|
}
|
|
@@ -66,30 +63,30 @@ function PropertyEnum(_ref) {
|
|
|
66
63
|
return window.removeEventListener('resize', handleResize);
|
|
67
64
|
};
|
|
68
65
|
}, []);
|
|
69
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
67
|
style: styles.enumWrapper
|
|
71
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
72
69
|
style: styles.enumTitle(fontSize)
|
|
73
|
-
}, configs.label), /*#__PURE__*/
|
|
70
|
+
}, configs.label), /*#__PURE__*/React.createElement(FormSelect, {
|
|
74
71
|
value: value,
|
|
75
72
|
onChange: function onChange(event) {
|
|
76
73
|
return update(event.target.value);
|
|
77
74
|
}
|
|
78
|
-
},
|
|
79
|
-
var _ref3 = (
|
|
75
|
+
}, Seq(configs.values).entrySeq().map(function (_ref2) {
|
|
76
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
80
77
|
key = _ref3[0],
|
|
81
78
|
value = _ref3[1];
|
|
82
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
83
80
|
key: key,
|
|
84
81
|
value: key
|
|
85
82
|
}, value);
|
|
86
83
|
})));
|
|
87
84
|
}
|
|
88
85
|
PropertyEnum.propTypes = {
|
|
89
|
-
value:
|
|
90
|
-
onUpdate:
|
|
91
|
-
configs:
|
|
92
|
-
sourceElement:
|
|
93
|
-
internalState:
|
|
94
|
-
state:
|
|
86
|
+
value: PropTypes.any.isRequired,
|
|
87
|
+
onUpdate: PropTypes.func.isRequired,
|
|
88
|
+
configs: PropTypes.object.isRequired,
|
|
89
|
+
sourceElement: PropTypes.object,
|
|
90
|
+
internalState: PropTypes.object,
|
|
91
|
+
state: PropTypes.object.isRequired
|
|
95
92
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
-
function PropertyHidden(_ref) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export default function PropertyHidden(_ref) {
|
|
7
4
|
var value = _ref.value,
|
|
8
5
|
onUpdate = _ref.onUpdate,
|
|
9
6
|
configs = _ref.configs,
|
|
@@ -13,10 +10,10 @@ function PropertyHidden(_ref) {
|
|
|
13
10
|
return null;
|
|
14
11
|
}
|
|
15
12
|
PropertyHidden.propTypes = {
|
|
16
|
-
value:
|
|
17
|
-
onUpdate:
|
|
18
|
-
configs:
|
|
19
|
-
sourceElement:
|
|
20
|
-
internalState:
|
|
21
|
-
state:
|
|
13
|
+
value: PropTypes.any.isRequired,
|
|
14
|
+
onUpdate: PropTypes.func.isRequired,
|
|
15
|
+
configs: PropTypes.object.isRequired,
|
|
16
|
+
sourceElement: PropTypes.object,
|
|
17
|
+
internalState: PropTypes.object,
|
|
18
|
+
state: PropTypes.object.isRequired
|
|
22
19
|
};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports["default"] = PropertyLengthMeasure;
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
5
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var _constants = require("./../../constants");
|
|
9
|
-
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
10
|
-
var _export = require("../../components/style/export");
|
|
11
|
-
var _immutable = require("immutable");
|
|
12
|
-
var _math = require("../../utils/math");
|
|
13
|
-
var _sharedPropertyStyle = _interopRequireDefault(require("./shared-property-style"));
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
14
3
|
var _excluded = ["hook", "label"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNIT_INCH, UNITS_LENGTH } from "./../../constants";
|
|
7
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
8
|
+
import { FormLabel, FormNumberInput, FormSelect } from "../../components/style/export";
|
|
9
|
+
import { Map } from 'immutable';
|
|
10
|
+
import { toFixedFloat } from "../../utils/math";
|
|
11
|
+
import PropertyStyle from "./shared-property-style";
|
|
15
12
|
var internalTableStyle = {
|
|
16
13
|
borderCollapse: 'collapse'
|
|
17
14
|
};
|
|
@@ -21,7 +18,7 @@ var secondTdStyle = {
|
|
|
21
18
|
var unitContainerStyle = {
|
|
22
19
|
width: '5em'
|
|
23
20
|
};
|
|
24
|
-
function PropertyLengthMeasure(_ref, _ref2) {
|
|
21
|
+
export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
25
22
|
var value = _ref.value,
|
|
26
23
|
onUpdate = _ref.onUpdate,
|
|
27
24
|
onValid = _ref.onValid,
|
|
@@ -32,22 +29,22 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
32
29
|
var catalog = _ref2.catalog;
|
|
33
30
|
var length = value.get('length') || 0; // length in inch
|
|
34
31
|
var _length = value.get('_length') || length; // length in unit
|
|
35
|
-
var _unit = value.get('_unit') ||
|
|
36
|
-
var type = value.get('type') ||
|
|
32
|
+
var _unit = value.get('_unit') || UNIT_INCH;
|
|
33
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
37
34
|
var hook = configs.hook,
|
|
38
35
|
label = configs.label,
|
|
39
|
-
configRest = (
|
|
36
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
40
37
|
var update = function update(lengthInput, unitInput, type) {
|
|
41
|
-
var newLength =
|
|
38
|
+
var newLength = toFixedFloat(lengthInput);
|
|
42
39
|
var merged = null;
|
|
43
40
|
if (type === 0) {
|
|
44
41
|
merged = value.merge({
|
|
45
|
-
length: unitInput !==
|
|
42
|
+
length: unitInput !== UNIT_INCH ? convert(newLength).from(unitInput).to(UNIT_INCH) : newLength,
|
|
46
43
|
_length: newLength
|
|
47
44
|
});
|
|
48
45
|
} else {
|
|
49
46
|
merged = value.merge({
|
|
50
|
-
_length:
|
|
47
|
+
_length: convert(newLength).from(UNIT_INCH).to(unitInput),
|
|
51
48
|
_unit: unitInput
|
|
52
49
|
});
|
|
53
50
|
}
|
|
@@ -58,46 +55,46 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
58
55
|
}
|
|
59
56
|
return onUpdate(merged);
|
|
60
57
|
};
|
|
61
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
62
59
|
className: "PropertyLengthMeasure",
|
|
63
|
-
style:
|
|
64
|
-
}, /*#__PURE__*/
|
|
65
|
-
style:
|
|
66
|
-
}, /*#__PURE__*/
|
|
60
|
+
style: PropertyStyle.tableStyle
|
|
61
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
62
|
+
style: PropertyStyle.firstTdStyle
|
|
63
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, label)), /*#__PURE__*/React.createElement("td", {
|
|
67
64
|
style: secondTdStyle
|
|
68
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
69
66
|
style: internalTableStyle
|
|
70
|
-
}, /*#__PURE__*/
|
|
71
|
-
disabled: type ===
|
|
67
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(FormNumberInput, _extends({
|
|
68
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
72
69
|
value: _length,
|
|
73
70
|
onChange: function onChange(event) {
|
|
74
71
|
return update(event.target.value, _unit, 0);
|
|
75
72
|
},
|
|
76
73
|
onValid: onValid
|
|
77
|
-
}, configRest))), /*#__PURE__*/
|
|
74
|
+
}, configRest))), /*#__PURE__*/React.createElement("td", {
|
|
78
75
|
style: unitContainerStyle
|
|
79
|
-
}, /*#__PURE__*/
|
|
80
|
-
disabled: type ===
|
|
76
|
+
}, /*#__PURE__*/React.createElement(FormSelect, {
|
|
77
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
81
78
|
value: _unit,
|
|
82
79
|
onChange: function onChange(event) {
|
|
83
80
|
return update(length, event.target.value, 1);
|
|
84
81
|
}
|
|
85
|
-
},
|
|
86
|
-
return /*#__PURE__*/
|
|
82
|
+
}, UNITS_LENGTH.map(function (el) {
|
|
83
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
87
84
|
key: el,
|
|
88
85
|
value: el
|
|
89
86
|
}, el);
|
|
90
87
|
}))))))))));
|
|
91
88
|
}
|
|
92
89
|
PropertyLengthMeasure.propTypes = {
|
|
93
|
-
value:
|
|
94
|
-
onUpdate:
|
|
95
|
-
onValid:
|
|
96
|
-
configs:
|
|
97
|
-
sourceElement:
|
|
98
|
-
internalState:
|
|
99
|
-
state:
|
|
90
|
+
value: PropTypes.instanceOf(Map).isRequired,
|
|
91
|
+
onUpdate: PropTypes.func.isRequired,
|
|
92
|
+
onValid: PropTypes.func,
|
|
93
|
+
configs: PropTypes.object.isRequired,
|
|
94
|
+
sourceElement: PropTypes.object,
|
|
95
|
+
internalState: PropTypes.object,
|
|
96
|
+
state: PropTypes.object.isRequired
|
|
100
97
|
};
|
|
101
98
|
PropertyLengthMeasure.contextTypes = {
|
|
102
|
-
catalog:
|
|
99
|
+
catalog: PropTypes.object.isRequired
|
|
103
100
|
};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
5
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
6
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _constants = require("../../constants");
|
|
10
|
-
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
11
|
-
var _export = require("../../components/style/export");
|
|
12
|
-
var _immutable = require("immutable");
|
|
13
|
-
var _math = require("../../utils/math");
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
14
4
|
var _excluded = ["hook", "label"];
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { BASE_CABINET_LAYOUTPOS, DEFAULT_FONT_FAMILY, TALL_CABINET_LAYOUTPOS, TEXT_COLOR_NEUTRAL_0, UNIT_CENTIMETER, UNIT_INCH } from "../../constants";
|
|
8
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
9
|
+
import { FormNumberInput } from "../../components/style/export";
|
|
10
|
+
import { Map } from 'immutable';
|
|
11
|
+
import { toFixedFloat } from "../../utils/math";
|
|
15
12
|
var styles = {
|
|
16
13
|
distanceFloorWrapper: {
|
|
17
14
|
display: 'flex',
|
|
@@ -22,8 +19,8 @@ var styles = {
|
|
|
22
19
|
return {
|
|
23
20
|
marginRight: 'auto',
|
|
24
21
|
width: 110,
|
|
25
|
-
color:
|
|
26
|
-
fontFamily:
|
|
22
|
+
color: TEXT_COLOR_NEUTRAL_0,
|
|
23
|
+
fontFamily: DEFAULT_FONT_FAMILY,
|
|
27
24
|
fontSize: fontSize,
|
|
28
25
|
fontWeight: 400,
|
|
29
26
|
lineHeight: '15px',
|
|
@@ -43,7 +40,7 @@ function getFontSize() {
|
|
|
43
40
|
}
|
|
44
41
|
return 13;
|
|
45
42
|
}
|
|
46
|
-
function PropertyLengthMeasure(_ref, _ref2) {
|
|
43
|
+
export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
47
44
|
var value = _ref.value,
|
|
48
45
|
onUpdate = _ref.onUpdate,
|
|
49
46
|
onValid = _ref.onValid,
|
|
@@ -57,25 +54,25 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
57
54
|
var length = value.get('length') || 0; // in centi
|
|
58
55
|
var _length = value.get('_length') || length; // in _unit
|
|
59
56
|
if (!_unit) {
|
|
60
|
-
_unit =
|
|
61
|
-
_length =
|
|
57
|
+
_unit = UNIT_INCH;
|
|
58
|
+
_length = convert(length).from(UNIT_CENTIMETER).to(UNIT_INCH);
|
|
62
59
|
}
|
|
63
|
-
var type = value.get('type') ||
|
|
60
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
64
61
|
var hook = configs.hook,
|
|
65
62
|
label = configs.label,
|
|
66
|
-
configRest = (
|
|
63
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
67
64
|
var update = function update(lengthInput, unitInput, type) {
|
|
68
|
-
var newLength =
|
|
65
|
+
var newLength = toFixedFloat(lengthInput);
|
|
69
66
|
var merged = null;
|
|
70
67
|
if (type === 0) {
|
|
71
68
|
merged = value.merge({
|
|
72
69
|
_length: newLength,
|
|
73
70
|
_unit: unitInput,
|
|
74
|
-
length:
|
|
71
|
+
length: convert(newLength).from(unitInput).to(UNIT_CENTIMETER)
|
|
75
72
|
});
|
|
76
73
|
} else {
|
|
77
74
|
merged = value.merge({
|
|
78
|
-
_length:
|
|
75
|
+
_length: convert(newLength).from(UNIT_CENTIMETER).to(unitInput),
|
|
79
76
|
_unit: unitInput,
|
|
80
77
|
length: newLength
|
|
81
78
|
});
|
|
@@ -87,11 +84,11 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
87
84
|
}
|
|
88
85
|
return onUpdate(merged);
|
|
89
86
|
};
|
|
90
|
-
var _React$useState =
|
|
91
|
-
_React$useState2 = (
|
|
87
|
+
var _React$useState = React.useState(getFontSize()),
|
|
88
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
92
89
|
fontSize = _React$useState2[0],
|
|
93
90
|
setFontSize = _React$useState2[1];
|
|
94
|
-
|
|
91
|
+
React.useEffect(function () {
|
|
95
92
|
function handleResize() {
|
|
96
93
|
setFontSize(getFontSize());
|
|
97
94
|
}
|
|
@@ -100,13 +97,13 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
100
97
|
return window.removeEventListener('resize', handleResize);
|
|
101
98
|
};
|
|
102
99
|
}, []);
|
|
103
|
-
return /*#__PURE__*/
|
|
100
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
104
101
|
style: styles.distanceFloorWrapper
|
|
105
|
-
}, /*#__PURE__*/
|
|
102
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
106
103
|
style: styles.distanceFloorTitle(fontSize)
|
|
107
|
-
}, label), /*#__PURE__*/
|
|
108
|
-
disabled: type ===
|
|
109
|
-
value:
|
|
104
|
+
}, label), /*#__PURE__*/React.createElement(FormNumberInput, _extends({
|
|
105
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
106
|
+
value: convert(_length).from('in').to(unit),
|
|
110
107
|
onChange: function onChange(event) {
|
|
111
108
|
return update(event.target.value, _unit, 0);
|
|
112
109
|
},
|
|
@@ -118,14 +115,14 @@ function PropertyLengthMeasure(_ref, _ref2) {
|
|
|
118
115
|
}, configRest)));
|
|
119
116
|
}
|
|
120
117
|
PropertyLengthMeasure.propTypes = {
|
|
121
|
-
value:
|
|
122
|
-
onUpdate:
|
|
123
|
-
onValid:
|
|
124
|
-
configs:
|
|
125
|
-
sourceElement:
|
|
126
|
-
internalState:
|
|
127
|
-
state:
|
|
118
|
+
value: PropTypes.instanceOf(Map).isRequired,
|
|
119
|
+
onUpdate: PropTypes.func.isRequired,
|
|
120
|
+
onValid: PropTypes.func,
|
|
121
|
+
configs: PropTypes.object.isRequired,
|
|
122
|
+
sourceElement: PropTypes.object,
|
|
123
|
+
internalState: PropTypes.object,
|
|
124
|
+
state: PropTypes.object.isRequired
|
|
128
125
|
};
|
|
129
126
|
PropertyLengthMeasure.contextTypes = {
|
|
130
|
-
catalog:
|
|
127
|
+
catalog: PropTypes.object.isRequired
|
|
131
128
|
};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports["default"] = PropertyLengthMeasureHole;
|
|
4
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
5
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var _constants = require("../../constants");
|
|
9
|
-
var _convertUnitsLite = require("../../utils/convert-units-lite");
|
|
10
|
-
var _export = require("../../components/style/export");
|
|
11
|
-
var _immutable = require("immutable");
|
|
12
|
-
var _math = require("../../utils/math");
|
|
13
|
-
var _sharedPropertyStyle = _interopRequireDefault(require("./shared-property-style"));
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
14
3
|
var _excluded = ["hook", "label"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNIT_INCH, UNITS_LENGTH } from "../../constants";
|
|
7
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
8
|
+
import { FormLabel, FormNumberInput1, FormSelect } from "../../components/style/export";
|
|
9
|
+
import { Map } from 'immutable';
|
|
10
|
+
import { toFixedFloat } from "../../utils/math";
|
|
11
|
+
import PropertyStyle from "./shared-property-style";
|
|
15
12
|
var internalTableStyle = {
|
|
16
13
|
borderCollapse: 'collapse'
|
|
17
14
|
};
|
|
@@ -21,7 +18,7 @@ var secondTdStyle = {
|
|
|
21
18
|
var unitContainerStyle = {
|
|
22
19
|
width: '3em'
|
|
23
20
|
};
|
|
24
|
-
function PropertyLengthMeasureHole(_ref, _ref2) {
|
|
21
|
+
export default function PropertyLengthMeasureHole(_ref, _ref2) {
|
|
25
22
|
var value = _ref.value,
|
|
26
23
|
onUpdate = _ref.onUpdate,
|
|
27
24
|
onValid = _ref.onValid,
|
|
@@ -30,24 +27,24 @@ function PropertyLengthMeasureHole(_ref, _ref2) {
|
|
|
30
27
|
internalState = _ref.internalState,
|
|
31
28
|
state = _ref.state;
|
|
32
29
|
var catalog = _ref2.catalog;
|
|
33
|
-
var _unit = value.get('_unit') ||
|
|
30
|
+
var _unit = value.get('_unit') || UNIT_INCH;
|
|
34
31
|
var _length = value.get('_length') || 0;
|
|
35
32
|
var length = value.get('length') || _length;
|
|
36
|
-
var type = value.get('type') ||
|
|
33
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
37
34
|
var hook = configs.hook,
|
|
38
35
|
label = configs.label,
|
|
39
|
-
configRest = (
|
|
36
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
40
37
|
var update = function update(lengthInput, unitInput, type) {
|
|
41
|
-
var newLength =
|
|
38
|
+
var newLength = toFixedFloat(lengthInput);
|
|
42
39
|
var merged = null;
|
|
43
40
|
if (type === 0) {
|
|
44
41
|
merged = value.merge({
|
|
45
42
|
_length: newLength,
|
|
46
|
-
length:
|
|
43
|
+
length: convert(newLength).from(unitInput).to('cm')
|
|
47
44
|
});
|
|
48
45
|
} else {
|
|
49
46
|
merged = value.merge({
|
|
50
|
-
_length:
|
|
47
|
+
_length: convert(newLength).from(UNIT_INCH).to(unitInput),
|
|
51
48
|
_unit: unitInput
|
|
52
49
|
});
|
|
53
50
|
}
|
|
@@ -58,46 +55,46 @@ function PropertyLengthMeasureHole(_ref, _ref2) {
|
|
|
58
55
|
}
|
|
59
56
|
return onUpdate(merged);
|
|
60
57
|
};
|
|
61
|
-
return /*#__PURE__*/
|
|
58
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
62
59
|
className: "PropertyLengthMeasure",
|
|
63
|
-
style:
|
|
64
|
-
}, /*#__PURE__*/
|
|
65
|
-
style:
|
|
66
|
-
}, /*#__PURE__*/
|
|
60
|
+
style: PropertyStyle.tableStyle
|
|
61
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
62
|
+
style: PropertyStyle.firstTdStyle
|
|
63
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, label)), /*#__PURE__*/React.createElement("td", {
|
|
67
64
|
style: secondTdStyle
|
|
68
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
69
66
|
style: internalTableStyle
|
|
70
|
-
}, /*#__PURE__*/
|
|
71
|
-
disabled: type ===
|
|
67
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(FormNumberInput1, _extends({
|
|
68
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
72
69
|
value: _length,
|
|
73
70
|
onChange: function onChange(event) {
|
|
74
71
|
return update(event.target.value, _unit, 0);
|
|
75
72
|
},
|
|
76
73
|
onValid: onValid
|
|
77
|
-
}, configRest))), /*#__PURE__*/
|
|
74
|
+
}, configRest))), /*#__PURE__*/React.createElement("td", {
|
|
78
75
|
style: unitContainerStyle
|
|
79
|
-
}, /*#__PURE__*/
|
|
80
|
-
disabled: type ===
|
|
76
|
+
}, /*#__PURE__*/React.createElement(FormSelect, {
|
|
77
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
81
78
|
value: _unit,
|
|
82
79
|
onChange: function onChange(event) {
|
|
83
80
|
return update(length, event.target.value, 1);
|
|
84
81
|
}
|
|
85
|
-
},
|
|
86
|
-
return /*#__PURE__*/
|
|
82
|
+
}, UNITS_LENGTH.map(function (el) {
|
|
83
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
87
84
|
key: el,
|
|
88
85
|
value: el
|
|
89
86
|
}, el);
|
|
90
87
|
}))))))))));
|
|
91
88
|
}
|
|
92
89
|
PropertyLengthMeasureHole.propTypes = {
|
|
93
|
-
value:
|
|
94
|
-
onUpdate:
|
|
95
|
-
onValid:
|
|
96
|
-
configs:
|
|
97
|
-
sourceElement:
|
|
98
|
-
internalState:
|
|
99
|
-
state:
|
|
90
|
+
value: PropTypes.instanceOf(Map).isRequired,
|
|
91
|
+
onUpdate: PropTypes.func.isRequired,
|
|
92
|
+
onValid: PropTypes.func,
|
|
93
|
+
configs: PropTypes.object.isRequired,
|
|
94
|
+
sourceElement: PropTypes.object,
|
|
95
|
+
internalState: PropTypes.object,
|
|
96
|
+
state: PropTypes.object.isRequired
|
|
100
97
|
};
|
|
101
98
|
PropertyLengthMeasureHole.contextTypes = {
|
|
102
|
-
catalog:
|
|
99
|
+
catalog: PropTypes.object.isRequired
|
|
103
100
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _export = require("../../components/style/export");
|
|
7
|
-
var _sharedPropertyStyle = _interopRequireDefault(require("./shared-property-style"));
|
|
8
|
-
function PropertyNumber(_ref) {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormLabel, FormNumberInput } from "../../components/style/export";
|
|
4
|
+
import PropertyStyle from "./shared-property-style";
|
|
5
|
+
export default function PropertyNumber(_ref) {
|
|
9
6
|
var value = _ref.value,
|
|
10
7
|
onUpdate = _ref.onUpdate,
|
|
11
8
|
onValid = _ref.onValid,
|
|
@@ -25,12 +22,12 @@ function PropertyNumber(_ref) {
|
|
|
25
22
|
}
|
|
26
23
|
return onUpdate(number);
|
|
27
24
|
};
|
|
28
|
-
return /*#__PURE__*/
|
|
25
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
29
26
|
className: "PropertyNumber",
|
|
30
|
-
style:
|
|
31
|
-
}, /*#__PURE__*/
|
|
32
|
-
style:
|
|
33
|
-
}, /*#__PURE__*/
|
|
27
|
+
style: PropertyStyle.tableStyle
|
|
28
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
29
|
+
style: PropertyStyle.firstTdStyle
|
|
30
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, configs.label)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(FormNumberInput, {
|
|
34
31
|
value: value,
|
|
35
32
|
onChange: function onChange(event) {
|
|
36
33
|
return update(event.target.value);
|
|
@@ -41,11 +38,11 @@ function PropertyNumber(_ref) {
|
|
|
41
38
|
})))));
|
|
42
39
|
}
|
|
43
40
|
PropertyNumber.propTypes = {
|
|
44
|
-
value:
|
|
45
|
-
onUpdate:
|
|
46
|
-
onValid:
|
|
47
|
-
configs:
|
|
48
|
-
sourceElement:
|
|
49
|
-
internalState:
|
|
50
|
-
state:
|
|
41
|
+
value: PropTypes.any.isRequired,
|
|
42
|
+
onUpdate: PropTypes.func.isRequired,
|
|
43
|
+
onValid: PropTypes.func,
|
|
44
|
+
configs: PropTypes.object.isRequired,
|
|
45
|
+
sourceElement: PropTypes.object,
|
|
46
|
+
internalState: PropTypes.object,
|
|
47
|
+
state: PropTypes.object.isRequired
|
|
51
48
|
};
|