kitchen-simulator 4.1.0-react-18 → 4.1.1
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/README.md +3 -0
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +162 -111
- package/es/LiteRenderer.js +161 -129
- package/es/actions/export.js +25 -12
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/catalog.js +21 -5
- package/es/catalog/factories/area-factory-3d.js +17 -17
- package/es/catalog/factories/wall-factory.js +1 -1
- package/es/catalog/holes/window-clear/planner-element.js +2 -2
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +68 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +50 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +100 -0
- package/es/catalog/properties/property-length-measure.js +84 -0
- package/es/catalog/properties/property-length-measure_hole.js +100 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/exporter.js +24 -11
- package/es/catalog/utils/item-loader.js +222 -213
- package/es/class/hole.js +0 -2
- package/es/class/item.js +89 -70
- package/es/class/layer.js +1 -1
- package/es/class/line.js +4 -8
- package/es/class/project.js +97 -80
- package/es/components/content.js +5 -93
- package/es/components/export.js +4 -6
- package/es/components/style/button.js +106 -0
- package/es/components/style/cancel-button.js +21 -0
- package/es/components/style/content-container.js +30 -0
- package/es/components/style/content-title.js +25 -0
- package/es/components/style/delete-button.js +24 -0
- package/es/components/style/export.js +28 -2
- package/es/components/style/form-block.js +20 -0
- package/es/components/style/form-color-input.js +26 -0
- package/es/components/style/form-label.js +22 -0
- package/es/components/style/form-number-input.js +29 -27
- package/es/components/style/form-number-input_2.js +200 -0
- package/es/components/style/form-select.js +19 -0
- package/es/components/style/form-slider.js +60 -0
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/style/form-text-input.js +69 -0
- package/es/components/viewer2d/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/group.js +5 -4
- package/es/components/viewer2d/item.js +155 -359
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +22 -52
- package/es/components/viewer2d/ruler.js +16 -11
- package/es/components/viewer2d/rulerDist.js +38 -51
- package/es/components/viewer2d/rulerX.js +4 -2
- package/es/components/viewer2d/rulerY.js +3 -0
- package/es/components/viewer2d/scene.js +17 -12
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/utils.js +2 -2
- package/es/components/viewer2d/vertex.js +3 -2
- package/es/components/viewer2d/viewer2d.js +56 -87
- package/es/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/es/components/viewer3d/scene-creator.js +255 -58
- package/es/components/viewer3d/viewer3d-first-person.js +24 -26
- package/es/components/viewer3d/viewer3d.js +103 -124
- package/es/constants.js +7 -2
- package/es/devLiteRenderer.js +491 -150
- package/es/index.js +590 -21
- package/es/models.js +13 -8
- package/es/plugins/SVGLoader.js +1414 -0
- package/es/plugins/console-debugger.js +34 -0
- package/es/plugins/export.js +7 -0
- package/es/plugins/keyboard.js +110 -0
- package/es/reducers/project-reducer.js +3 -0
- package/es/reducers/viewer2d-reducer.js +3 -1
- package/es/reducers/viewer3d-reducer.js +3 -1
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/utils/geometry.js +77 -119
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +827 -607
- package/es/utils/molding.js +459 -11
- package/es/utils/ruler.js +58 -0
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +161 -111
- package/lib/LiteRenderer.js +160 -129
- package/lib/actions/export.js +35 -39
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/catalog.js +20 -4
- package/lib/catalog/factories/area-factory-3d.js +14 -14
- package/lib/catalog/factories/wall-factory.js +1 -1
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +81 -0
- package/lib/catalog/properties/property-checkbox.js +76 -0
- package/lib/catalog/properties/property-color.js +47 -0
- package/lib/catalog/properties/property-enum.js +58 -0
- package/lib/catalog/properties/property-hidden.js +27 -0
- package/lib/catalog/properties/property-lenght-measure.js +108 -0
- package/lib/catalog/properties/property-length-measure.js +92 -0
- package/lib/catalog/properties/property-length-measure_hole.js +108 -0
- package/lib/catalog/properties/property-number.js +56 -0
- package/lib/catalog/properties/property-read-only.js +34 -0
- package/lib/catalog/properties/property-string.js +56 -0
- package/lib/catalog/properties/property-toggle.js +47 -0
- package/lib/catalog/properties/shared-property-style.js +21 -0
- package/lib/catalog/utils/exporter.js +24 -11
- package/lib/catalog/utils/item-loader.js +219 -210
- package/lib/class/hole.js +0 -2
- package/lib/class/item.js +87 -68
- package/lib/class/layer.js +1 -1
- package/lib/class/line.js +3 -7
- package/lib/class/project.js +97 -80
- package/lib/components/content.js +5 -93
- package/lib/components/export.js +6 -26
- package/lib/components/style/button.js +115 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +38 -0
- package/lib/components/style/content-title.js +35 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +105 -1
- package/lib/components/style/form-block.js +28 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +30 -0
- package/lib/components/style/form-number-input.js +29 -27
- package/lib/components/style/form-number-input_2.js +209 -0
- package/lib/components/style/form-select.js +29 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +78 -0
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/group.js +5 -4
- package/lib/components/viewer2d/item.js +152 -356
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +22 -52
- package/lib/components/viewer2d/ruler.js +15 -10
- package/lib/components/viewer2d/rulerDist.js +38 -51
- package/lib/components/viewer2d/rulerX.js +4 -2
- package/lib/components/viewer2d/rulerY.js +3 -0
- package/lib/components/viewer2d/scene.js +17 -12
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/utils.js +2 -2
- package/lib/components/viewer2d/vertex.js +3 -2
- package/lib/components/viewer2d/viewer2d.js +54 -84
- package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/lib/components/viewer3d/scene-creator.js +252 -55
- package/lib/components/viewer3d/viewer3d-first-person.js +24 -26
- package/lib/components/viewer3d/viewer3d.js +100 -120
- package/lib/constants.js +12 -7
- package/lib/devLiteRenderer.js +489 -148
- package/lib/index.js +592 -21
- package/lib/models.js +13 -8
- package/lib/plugins/SVGLoader.js +1419 -0
- package/lib/plugins/console-debugger.js +42 -0
- package/lib/plugins/export.js +25 -0
- package/lib/plugins/keyboard.js +117 -0
- package/lib/reducers/project-reducer.js +3 -0
- package/lib/reducers/viewer2d-reducer.js +3 -1
- package/lib/reducers/viewer3d-reducer.js +3 -1
- package/lib/styles/export.js +13 -0
- package/lib/styles/tabs.css +40 -0
- package/lib/utils/geometry.js +77 -119
- package/lib/utils/helper.js +40 -1
- package/lib/utils/isolate-event-handler.js +827 -606
- package/lib/utils/molding.js +460 -9
- package/lib/utils/ruler.js +63 -0
- package/package.json +20 -15
- package/es/mocks/appliancePayload.json +0 -27
- package/es/mocks/cabinetPayload.json +0 -1914
- package/es/mocks/cabinetPayload2.json +0 -76
- package/es/mocks/dataBundle2.json +0 -4
- package/es/mocks/distancePayload.json +0 -6
- package/es/mocks/doorStylePayload2.json +0 -84
- package/es/mocks/furnishingPayload.json +0 -23
- package/es/mocks/itemCDSPayload.json +0 -27
- package/es/mocks/lightingPayload.json +0 -23
- package/es/mocks/mockProps.json +0 -43
- package/es/mocks/mockProps2.json +0 -9
- package/es/mocks/moldingPayload.json +0 -19
- package/es/mocks/projectItemsCatalog.json +0 -133
- package/es/mocks/rectangleShape.json +0 -238
- package/es/mocks/replaceCabinetPayload.json +0 -81
- package/es/mocks/roomShapePayload.json +0 -5
- package/es/useAppContext.js +0 -8
- package/lib/mocks/appliancePayload.json +0 -27
- package/lib/mocks/cabinetPayload.json +0 -1914
- package/lib/mocks/cabinetPayload2.json +0 -76
- package/lib/mocks/dataBundle2.json +0 -4
- package/lib/mocks/distancePayload.json +0 -6
- package/lib/mocks/doorStylePayload2.json +0 -84
- package/lib/mocks/furnishingPayload.json +0 -23
- package/lib/mocks/itemCDSPayload.json +0 -27
- package/lib/mocks/lightingPayload.json +0 -23
- package/lib/mocks/mockProps.json +0 -43
- package/lib/mocks/mockProps2.json +0 -9
- package/lib/mocks/moldingPayload.json +0 -19
- package/lib/mocks/projectItemsCatalog.json +0 -133
- package/lib/mocks/rectangleShape.json +0 -238
- package/lib/mocks/replaceCabinetPayload.json +0 -81
- package/lib/mocks/roomShapePayload.json +0 -5
- package/lib/useAppContext.js +0 -16
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PropertyColor from "./property-color";
|
|
2
|
+
import PropertyEnum from "./property-enum";
|
|
3
|
+
import PropertyString from "./property-string";
|
|
4
|
+
import PropertyNumber from "./property-number";
|
|
5
|
+
import PropertyLengthMeasure from "./property-length-measure";
|
|
6
|
+
import PropertyToggle from "./property-toggle";
|
|
7
|
+
import PropertyCheckbox from "./property-checkbox";
|
|
8
|
+
import PropertyHidden from "./property-hidden";
|
|
9
|
+
import PropertyReadOnly from "./property-read-only";
|
|
10
|
+
export { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly };
|
|
11
|
+
export default {
|
|
12
|
+
PropertyColor: PropertyColor,
|
|
13
|
+
PropertyEnum: PropertyEnum,
|
|
14
|
+
PropertyString: PropertyString,
|
|
15
|
+
PropertyNumber: PropertyNumber,
|
|
16
|
+
PropertyLengthMeasure: PropertyLengthMeasure,
|
|
17
|
+
PropertyToggle: PropertyToggle,
|
|
18
|
+
PropertyCheckbox: PropertyCheckbox,
|
|
19
|
+
PropertyHidden: PropertyHidden,
|
|
20
|
+
PropertyReadOnly: PropertyReadOnly
|
|
21
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { FormLabel } from "../../components/style/export";
|
|
9
|
+
import PropertyStyle from "./shared-property-style";
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
|
|
12
|
+
var FlipWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: 15px 0;\n justify-content: space-between;\n"])));
|
|
13
|
+
var FlipTitle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: auto;\n color: ", ";\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n line-height: 18px;\n text-align: left;\n"])), SECONDARY_PURPLE_COLOR, DEFAULT_FONT_FAMILY);
|
|
14
|
+
var FlipDescription = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-right: auto;\n color: ", ";\n font-family: ", ";\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n text-align: left;\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY);
|
|
15
|
+
var FlipInfoWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
16
|
+
var FlipToggle = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n"])));
|
|
17
|
+
var FlipToggleIcon = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n top: 0;\n position: absolute;\n ", "\n img {\n font-size: 1.4rem;\n box-sizing: border-box;\n border-radius: 50%;\n }\n"])), '' /* transition-duration: .3s; */);
|
|
18
|
+
export default function PropertyCheckbox(_ref) {
|
|
19
|
+
var value = _ref.value,
|
|
20
|
+
onUpdate = _ref.onUpdate,
|
|
21
|
+
configs = _ref.configs,
|
|
22
|
+
sourceElement = _ref.sourceElement,
|
|
23
|
+
internalState = _ref.internalState,
|
|
24
|
+
state = _ref.state;
|
|
25
|
+
var update = function update(val) {
|
|
26
|
+
if (configs.hook) {
|
|
27
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
28
|
+
return onUpdate(_val);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return onUpdate(val);
|
|
32
|
+
};
|
|
33
|
+
var activeStyle = value == 0 ? {
|
|
34
|
+
left: 0
|
|
35
|
+
} : {
|
|
36
|
+
right: 0
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/React.createElement(FlipWrapper, null, /*#__PURE__*/React.createElement(FlipInfoWrapper, null, /*#__PURE__*/React.createElement(FlipTitle, null, configs.label), configs.description && /*#__PURE__*/React.createElement(FlipDescription, null, configs.description)), /*#__PURE__*/React.createElement(FlipToggle, {
|
|
39
|
+
style: {
|
|
40
|
+
color: 'black'
|
|
41
|
+
},
|
|
42
|
+
onClick: function onClick(e) {
|
|
43
|
+
return update(!value);
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
46
|
+
src: "/assets/img/svg/bottombar/".concat(value != 0 ? '2d3d_toggle_active.svg' : '2d3d_toggle.svg'),
|
|
47
|
+
style: {
|
|
48
|
+
width: '55px',
|
|
49
|
+
height: '30px'
|
|
50
|
+
}
|
|
51
|
+
}), /*#__PURE__*/React.createElement(FlipToggleIcon, {
|
|
52
|
+
style: _objectSpread({}, activeStyle)
|
|
53
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
54
|
+
src: "/assets/img/svg/bottombar/".concat(value != 0 ? '2d3d_button_active.svg' : '2d3d_button.svg'),
|
|
55
|
+
style: {
|
|
56
|
+
width: '30px',
|
|
57
|
+
height: '30px'
|
|
58
|
+
}
|
|
59
|
+
}))));
|
|
60
|
+
}
|
|
61
|
+
PropertyCheckbox.propTypes = {
|
|
62
|
+
value: PropTypes.any.isRequired,
|
|
63
|
+
onUpdate: PropTypes.func.isRequired,
|
|
64
|
+
configs: PropTypes.object.isRequired,
|
|
65
|
+
sourceElement: PropTypes.object,
|
|
66
|
+
internalState: PropTypes.object,
|
|
67
|
+
state: PropTypes.object.isRequired
|
|
68
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
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) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
onUpdate = _ref.onUpdate,
|
|
8
|
+
configs = _ref.configs,
|
|
9
|
+
sourceElement = _ref.sourceElement,
|
|
10
|
+
internalState = _ref.internalState,
|
|
11
|
+
state = _ref.state;
|
|
12
|
+
var update = function update(val) {
|
|
13
|
+
if (configs.hook) {
|
|
14
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
15
|
+
return onUpdate(_val);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return onUpdate(val);
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
21
|
+
className: "PropertyColor",
|
|
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, {
|
|
26
|
+
value: value,
|
|
27
|
+
onChange: function onChange(event) {
|
|
28
|
+
return update(event.target.value);
|
|
29
|
+
}
|
|
30
|
+
})))));
|
|
31
|
+
}
|
|
32
|
+
PropertyColor.propTypes = {
|
|
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
|
|
39
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { Seq } from 'immutable';
|
|
7
|
+
import { FormLabel, FormSelect } from "../../components/style/export";
|
|
8
|
+
import PropertyStyle from "./shared-property-style";
|
|
9
|
+
import styled from 'styled-components';
|
|
10
|
+
import { TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY } from "../../constants";
|
|
11
|
+
var EnumWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-top: 3px;\n"])));
|
|
12
|
+
var EnumTitle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: auto;\n width: 110px;\n color: ", ";\n font-family: ", ";\n\n @media screen and (min-width: 1024) {\n font-size: 11px;\n }\n @media screen and (max-width: 1024) {\n font-size: 11px;\n }\n @media screen and (min-width: 1366) {\n font-size: 13px;\n }\n @media screen and (max-width: 1366) {\n font-size: 13px;\n }\n @media screen and (min-width: 1440) {\n font-size: 16px;\n }\n @media screen and (max-width: 1440) {\n font-size: 16px;\n }\n font-weight: 400;\n line-height: 15px;\n text-align: left;\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY);
|
|
13
|
+
export default function PropertyEnum(_ref) {
|
|
14
|
+
var value = _ref.value,
|
|
15
|
+
onUpdate = _ref.onUpdate,
|
|
16
|
+
configs = _ref.configs,
|
|
17
|
+
sourceElement = _ref.sourceElement,
|
|
18
|
+
internalState = _ref.internalState,
|
|
19
|
+
state = _ref.state;
|
|
20
|
+
var update = function update(val) {
|
|
21
|
+
if (configs.hook) {
|
|
22
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
23
|
+
return onUpdate(_val);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return onUpdate(val);
|
|
27
|
+
};
|
|
28
|
+
return /*#__PURE__*/React.createElement(EnumWrapper, null, /*#__PURE__*/React.createElement(EnumTitle, null, configs.label), /*#__PURE__*/React.createElement(FormSelect, {
|
|
29
|
+
value: value,
|
|
30
|
+
onChange: function onChange(event) {
|
|
31
|
+
return update(event.target.value);
|
|
32
|
+
}
|
|
33
|
+
}, Seq(configs.values).entrySeq().map(function (_ref2) {
|
|
34
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
35
|
+
key = _ref3[0],
|
|
36
|
+
value = _ref3[1];
|
|
37
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
38
|
+
key: key,
|
|
39
|
+
value: key
|
|
40
|
+
}, value);
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
PropertyEnum.propTypes = {
|
|
44
|
+
value: PropTypes.any.isRequired,
|
|
45
|
+
onUpdate: PropTypes.func.isRequired,
|
|
46
|
+
configs: PropTypes.object.isRequired,
|
|
47
|
+
sourceElement: PropTypes.object,
|
|
48
|
+
internalState: PropTypes.object,
|
|
49
|
+
state: PropTypes.object.isRequired
|
|
50
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export default function PropertyHidden(_ref) {
|
|
4
|
+
var value = _ref.value,
|
|
5
|
+
onUpdate = _ref.onUpdate,
|
|
6
|
+
configs = _ref.configs,
|
|
7
|
+
sourceElement = _ref.sourceElement,
|
|
8
|
+
internalState = _ref.internalState,
|
|
9
|
+
state = _ref.state;
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
PropertyHidden.propTypes = {
|
|
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
|
|
19
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["hook", "label"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { BASE_CABINET_LAYOUTPOS, TALL_CABINET_LAYOUTPOS, UNITS_LENGTH, UNIT_INCH } 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";
|
|
12
|
+
var internalTableStyle = {
|
|
13
|
+
borderCollapse: 'collapse'
|
|
14
|
+
};
|
|
15
|
+
var secondTdStyle = {
|
|
16
|
+
padding: 0
|
|
17
|
+
};
|
|
18
|
+
var unitContainerStyle = {
|
|
19
|
+
width: '5em'
|
|
20
|
+
};
|
|
21
|
+
export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
22
|
+
var value = _ref.value,
|
|
23
|
+
onUpdate = _ref.onUpdate,
|
|
24
|
+
onValid = _ref.onValid,
|
|
25
|
+
configs = _ref.configs,
|
|
26
|
+
sourceElement = _ref.sourceElement,
|
|
27
|
+
internalState = _ref.internalState,
|
|
28
|
+
state = _ref.state;
|
|
29
|
+
var catalog = _ref2.catalog;
|
|
30
|
+
var length = value.get('length') || 0; // length in inch
|
|
31
|
+
var _length = value.get('_length') || length; // length in unit
|
|
32
|
+
var _unit = value.get('_unit') || UNIT_INCH;
|
|
33
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
34
|
+
var hook = configs.hook,
|
|
35
|
+
label = configs.label,
|
|
36
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
37
|
+
var update = function update(lengthInput, unitInput, type) {
|
|
38
|
+
var newLength = toFixedFloat(lengthInput);
|
|
39
|
+
var merged = null;
|
|
40
|
+
if (type === 0) {
|
|
41
|
+
merged = value.merge({
|
|
42
|
+
length: unitInput !== UNIT_INCH ? convert(newLength).from(unitInput).to(UNIT_INCH) : newLength,
|
|
43
|
+
_length: newLength
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
merged = value.merge({
|
|
47
|
+
_length: convert(newLength).from(UNIT_INCH).to(unitInput),
|
|
48
|
+
_unit: unitInput
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (hook) {
|
|
52
|
+
return hook(merged, sourceElement, internalState, state).then(function (val) {
|
|
53
|
+
return onUpdate(val);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return onUpdate(merged);
|
|
57
|
+
};
|
|
58
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
59
|
+
className: "PropertyLengthMeasure",
|
|
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", {
|
|
64
|
+
style: secondTdStyle
|
|
65
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
66
|
+
style: internalTableStyle
|
|
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,
|
|
69
|
+
value: _length,
|
|
70
|
+
onChange: function onChange(event) {
|
|
71
|
+
return update(event.target.value, _unit, 0);
|
|
72
|
+
},
|
|
73
|
+
onValid: onValid
|
|
74
|
+
}, configRest))), /*#__PURE__*/React.createElement("td", {
|
|
75
|
+
style: unitContainerStyle
|
|
76
|
+
}, /*#__PURE__*/React.createElement(FormSelect, {
|
|
77
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
78
|
+
value: _unit,
|
|
79
|
+
onChange: function onChange(event) {
|
|
80
|
+
return update(length, event.target.value, 1);
|
|
81
|
+
}
|
|
82
|
+
}, UNITS_LENGTH.map(function (el) {
|
|
83
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
84
|
+
key: el,
|
|
85
|
+
value: el
|
|
86
|
+
}, el);
|
|
87
|
+
}))))))))));
|
|
88
|
+
}
|
|
89
|
+
PropertyLengthMeasure.propTypes = {
|
|
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
|
|
97
|
+
};
|
|
98
|
+
PropertyLengthMeasure.contextTypes = {
|
|
99
|
+
catalog: PropTypes.object.isRequired
|
|
100
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
4
|
+
var _excluded = ["hook", "label"];
|
|
5
|
+
var _templateObject, _templateObject2;
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { BASE_CABINET_LAYOUTPOS, DEFAULT_FONT_FAMILY, TALL_CABINET_LAYOUTPOS, TEXT_COLOR_NEUTRAL_0, UNIT_CENTIMETER, UNIT_INCH } from "../../constants";
|
|
9
|
+
import { convert } from "../../utils/convert-units-lite";
|
|
10
|
+
import { FormNumberInput } from "../../components/style/export";
|
|
11
|
+
import { Map } from 'immutable';
|
|
12
|
+
import { toFixedFloat } from "../../utils/math";
|
|
13
|
+
import styled from 'styled-components';
|
|
14
|
+
var DistanceFloorWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-top: 3px;\n"])));
|
|
15
|
+
var DistanceFloorTitle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: auto;\n width: 110px;\n color: ", ";\n font-family: ", ";\n font-size: 16px;\n\n @media screen and (min-width: 1024) {\n font-size: 11px;\n }\n @media screen and (max-width: 1024) {\n font-size: 11px;\n }\n @media screen and (min-width: 1366) {\n font-size: 13px;\n }\n @media screen and (max-width: 1366) {\n font-size: 13px;\n }\n @media screen and (min-width: 1440) {\n font-size: 16px;\n }\n @media screen and (max-width: 1440) {\n font-size: 16px;\n }\n font-weight: 400;\n line-height: 15px;\n text-align: left;\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY);
|
|
16
|
+
export default function PropertyLengthMeasure(_ref, _ref2) {
|
|
17
|
+
var value = _ref.value,
|
|
18
|
+
onUpdate = _ref.onUpdate,
|
|
19
|
+
onValid = _ref.onValid,
|
|
20
|
+
configs = _ref.configs,
|
|
21
|
+
sourceElement = _ref.sourceElement,
|
|
22
|
+
internalState = _ref.internalState,
|
|
23
|
+
state = _ref.state;
|
|
24
|
+
var catalog = _ref2.catalog;
|
|
25
|
+
var _unit = value.get('_unit');
|
|
26
|
+
var unit = state.getIn(['scene', 'layers', state.scene.selectedLayer, 'unit']);
|
|
27
|
+
var length = value.get('length') || 0; // in centi
|
|
28
|
+
var _length = value.get('_length') || length; // in _unit
|
|
29
|
+
if (!_unit) {
|
|
30
|
+
_unit = UNIT_INCH;
|
|
31
|
+
_length = convert(length).from(UNIT_CENTIMETER).to(UNIT_INCH);
|
|
32
|
+
}
|
|
33
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
34
|
+
var hook = configs.hook,
|
|
35
|
+
label = configs.label,
|
|
36
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
37
|
+
var update = function update(lengthInput, unitInput, type) {
|
|
38
|
+
var newLength = toFixedFloat(lengthInput);
|
|
39
|
+
var merged = null;
|
|
40
|
+
if (type === 0) {
|
|
41
|
+
merged = value.merge({
|
|
42
|
+
_length: newLength,
|
|
43
|
+
_unit: unitInput,
|
|
44
|
+
length: convert(newLength).from(unitInput).to(UNIT_CENTIMETER)
|
|
45
|
+
});
|
|
46
|
+
} else {
|
|
47
|
+
merged = value.merge({
|
|
48
|
+
_length: convert(newLength).from(UNIT_CENTIMETER).to(unitInput),
|
|
49
|
+
_unit: unitInput,
|
|
50
|
+
length: newLength
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (hook) {
|
|
54
|
+
return hook(merged, sourceElement, internalState, state).then(function (val) {
|
|
55
|
+
return onUpdate(val);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return onUpdate(merged);
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/React.createElement(DistanceFloorWrapper, null, /*#__PURE__*/React.createElement(DistanceFloorTitle, null, label), /*#__PURE__*/React.createElement(FormNumberInput, _extends({
|
|
61
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
62
|
+
value: convert(_length).from('in').to(unit),
|
|
63
|
+
onChange: function onChange(event) {
|
|
64
|
+
return update(event.target.value, _unit, 0);
|
|
65
|
+
},
|
|
66
|
+
onValid: onValid,
|
|
67
|
+
labelName: label,
|
|
68
|
+
style: {
|
|
69
|
+
paddingRight: '40px'
|
|
70
|
+
}
|
|
71
|
+
}, configRest)));
|
|
72
|
+
}
|
|
73
|
+
PropertyLengthMeasure.propTypes = {
|
|
74
|
+
value: PropTypes.instanceOf(Map).isRequired,
|
|
75
|
+
onUpdate: PropTypes.func.isRequired,
|
|
76
|
+
onValid: PropTypes.func,
|
|
77
|
+
configs: PropTypes.object.isRequired,
|
|
78
|
+
sourceElement: PropTypes.object,
|
|
79
|
+
internalState: PropTypes.object,
|
|
80
|
+
state: PropTypes.object.isRequired
|
|
81
|
+
};
|
|
82
|
+
PropertyLengthMeasure.contextTypes = {
|
|
83
|
+
catalog: PropTypes.object.isRequired
|
|
84
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
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";
|
|
12
|
+
var internalTableStyle = {
|
|
13
|
+
borderCollapse: 'collapse'
|
|
14
|
+
};
|
|
15
|
+
var secondTdStyle = {
|
|
16
|
+
padding: 0
|
|
17
|
+
};
|
|
18
|
+
var unitContainerStyle = {
|
|
19
|
+
width: '3em'
|
|
20
|
+
};
|
|
21
|
+
export default function PropertyLengthMeasureHole(_ref, _ref2) {
|
|
22
|
+
var value = _ref.value,
|
|
23
|
+
onUpdate = _ref.onUpdate,
|
|
24
|
+
onValid = _ref.onValid,
|
|
25
|
+
configs = _ref.configs,
|
|
26
|
+
sourceElement = _ref.sourceElement,
|
|
27
|
+
internalState = _ref.internalState,
|
|
28
|
+
state = _ref.state;
|
|
29
|
+
var catalog = _ref2.catalog;
|
|
30
|
+
var _unit = value.get('_unit') || UNIT_INCH;
|
|
31
|
+
var _length = value.get('_length') || 0;
|
|
32
|
+
var length = value.get('length') || _length;
|
|
33
|
+
var type = value.get('type') || BASE_CABINET_LAYOUTPOS;
|
|
34
|
+
var hook = configs.hook,
|
|
35
|
+
label = configs.label,
|
|
36
|
+
configRest = _objectWithoutProperties(configs, _excluded);
|
|
37
|
+
var update = function update(lengthInput, unitInput, type) {
|
|
38
|
+
var newLength = toFixedFloat(lengthInput);
|
|
39
|
+
var merged = null;
|
|
40
|
+
if (type === 0) {
|
|
41
|
+
merged = value.merge({
|
|
42
|
+
_length: newLength,
|
|
43
|
+
length: convert(newLength).from(unitInput).to('cm')
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
merged = value.merge({
|
|
47
|
+
_length: convert(newLength).from(UNIT_INCH).to(unitInput),
|
|
48
|
+
_unit: unitInput
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (hook) {
|
|
52
|
+
return hook(merged, sourceElement, internalState, state).then(function (val) {
|
|
53
|
+
return onUpdate(val);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return onUpdate(merged);
|
|
57
|
+
};
|
|
58
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
59
|
+
className: "PropertyLengthMeasure",
|
|
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", {
|
|
64
|
+
style: secondTdStyle
|
|
65
|
+
}, /*#__PURE__*/React.createElement("table", {
|
|
66
|
+
style: internalTableStyle
|
|
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,
|
|
69
|
+
value: _length,
|
|
70
|
+
onChange: function onChange(event) {
|
|
71
|
+
return update(event.target.value, _unit, 0);
|
|
72
|
+
},
|
|
73
|
+
onValid: onValid
|
|
74
|
+
}, configRest))), /*#__PURE__*/React.createElement("td", {
|
|
75
|
+
style: unitContainerStyle
|
|
76
|
+
}, /*#__PURE__*/React.createElement(FormSelect, {
|
|
77
|
+
disabled: type === TALL_CABINET_LAYOUTPOS,
|
|
78
|
+
value: _unit,
|
|
79
|
+
onChange: function onChange(event) {
|
|
80
|
+
return update(length, event.target.value, 1);
|
|
81
|
+
}
|
|
82
|
+
}, UNITS_LENGTH.map(function (el) {
|
|
83
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
84
|
+
key: el,
|
|
85
|
+
value: el
|
|
86
|
+
}, el);
|
|
87
|
+
}))))))))));
|
|
88
|
+
}
|
|
89
|
+
PropertyLengthMeasureHole.propTypes = {
|
|
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
|
|
97
|
+
};
|
|
98
|
+
PropertyLengthMeasureHole.contextTypes = {
|
|
99
|
+
catalog: PropTypes.object.isRequired
|
|
100
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
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) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
onUpdate = _ref.onUpdate,
|
|
8
|
+
onValid = _ref.onValid,
|
|
9
|
+
configs = _ref.configs,
|
|
10
|
+
sourceElement = _ref.sourceElement,
|
|
11
|
+
internalState = _ref.internalState,
|
|
12
|
+
state = _ref.state;
|
|
13
|
+
var update = function update(val) {
|
|
14
|
+
var number = parseFloat(val);
|
|
15
|
+
if (isNaN(number)) {
|
|
16
|
+
number = 0;
|
|
17
|
+
}
|
|
18
|
+
if (configs.hook) {
|
|
19
|
+
return configs.hook(number, sourceElement, internalState, state).then(function (_val) {
|
|
20
|
+
return onUpdate(_val);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return onUpdate(number);
|
|
24
|
+
};
|
|
25
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
26
|
+
className: "PropertyNumber",
|
|
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, {
|
|
31
|
+
value: value,
|
|
32
|
+
onChange: function onChange(event) {
|
|
33
|
+
return update(event.target.value);
|
|
34
|
+
},
|
|
35
|
+
onValid: onValid,
|
|
36
|
+
min: configs.min,
|
|
37
|
+
max: configs.max
|
|
38
|
+
})))));
|
|
39
|
+
}
|
|
40
|
+
PropertyNumber.propTypes = {
|
|
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
|
|
48
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormLabel } from "../../components/style/export";
|
|
4
|
+
import PropertyStyle from "./shared-property-style";
|
|
5
|
+
export default function PropertyReadOnly(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
onUpdate = _ref.onUpdate,
|
|
8
|
+
configs = _ref.configs,
|
|
9
|
+
sourceElement = _ref.sourceElement,
|
|
10
|
+
internalState = _ref.internalState,
|
|
11
|
+
state = _ref.state;
|
|
12
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
13
|
+
className: "PropertyReadOnly",
|
|
14
|
+
style: PropertyStyle.tableStyle
|
|
15
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
16
|
+
style: PropertyStyle.firstTdStyle
|
|
17
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, configs.label)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", null, value)))));
|
|
18
|
+
}
|
|
19
|
+
PropertyReadOnly.propTypes = {
|
|
20
|
+
value: PropTypes.any.isRequired,
|
|
21
|
+
onUpdate: PropTypes.func.isRequired,
|
|
22
|
+
configs: PropTypes.object.isRequired,
|
|
23
|
+
sourceElement: PropTypes.object,
|
|
24
|
+
internalState: PropTypes.object,
|
|
25
|
+
state: PropTypes.object.isRequired
|
|
26
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormLabel, FormTextInput } from "../../components/style/export";
|
|
4
|
+
import PropertyStyle from "./shared-property-style";
|
|
5
|
+
var tableStyle = {
|
|
6
|
+
width: '100%',
|
|
7
|
+
borderSpacing: '2px 0',
|
|
8
|
+
marginBottom: '2px'
|
|
9
|
+
};
|
|
10
|
+
var firstTdStyle = {
|
|
11
|
+
width: '6em',
|
|
12
|
+
textTransform: 'capitalize'
|
|
13
|
+
};
|
|
14
|
+
export default function PropertyString(_ref) {
|
|
15
|
+
var value = _ref.value,
|
|
16
|
+
onUpdate = _ref.onUpdate,
|
|
17
|
+
configs = _ref.configs,
|
|
18
|
+
sourceElement = _ref.sourceElement,
|
|
19
|
+
internalState = _ref.internalState,
|
|
20
|
+
state = _ref.state;
|
|
21
|
+
var update = function update(val) {
|
|
22
|
+
if (configs.hook) {
|
|
23
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
24
|
+
return onUpdate(_val);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return onUpdate(val);
|
|
28
|
+
};
|
|
29
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
30
|
+
className: "PropertyString",
|
|
31
|
+
style: PropertyStyle.tableStyle
|
|
32
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
|
|
33
|
+
style: PropertyStyle.firstTdStyle
|
|
34
|
+
}, /*#__PURE__*/React.createElement(FormLabel, null, configs.label)), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(FormTextInput, {
|
|
35
|
+
value: value,
|
|
36
|
+
onChange: function onChange(event) {
|
|
37
|
+
return update(event.target.value);
|
|
38
|
+
}
|
|
39
|
+
})))));
|
|
40
|
+
}
|
|
41
|
+
PropertyString.propTypes = {
|
|
42
|
+
value: PropTypes.any.isRequired,
|
|
43
|
+
onUpdate: PropTypes.func.isRequired,
|
|
44
|
+
configs: PropTypes.object.isRequired,
|
|
45
|
+
sourceElement: PropTypes.object,
|
|
46
|
+
internalState: PropTypes.object,
|
|
47
|
+
state: PropTypes.object.isRequired
|
|
48
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormLabel, Button } from "../../components/style/export";
|
|
4
|
+
import PropertyStyle from "./shared-property-style";
|
|
5
|
+
export default function PropertyToggle(_ref) {
|
|
6
|
+
var value = _ref.value,
|
|
7
|
+
onUpdate = _ref.onUpdate,
|
|
8
|
+
configs = _ref.configs,
|
|
9
|
+
sourceElement = _ref.sourceElement,
|
|
10
|
+
internalState = _ref.internalState,
|
|
11
|
+
state = _ref.state;
|
|
12
|
+
var update = function update(val) {
|
|
13
|
+
if (configs.hook) {
|
|
14
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
15
|
+
return onUpdate(_val);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return onUpdate(val);
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/React.createElement("table", {
|
|
21
|
+
className: "PropertyToggle",
|
|
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(Button, {
|
|
26
|
+
onClick: function onClick(e) {
|
|
27
|
+
return update(!value);
|
|
28
|
+
},
|
|
29
|
+
size: "small"
|
|
30
|
+
}, configs.actionName)))));
|
|
31
|
+
}
|
|
32
|
+
PropertyToggle.propTypes = {
|
|
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
|
|
39
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var tableStyle = {
|
|
2
|
+
width: '100%',
|
|
3
|
+
borderSpacing: '2px 0',
|
|
4
|
+
marginBottom: '2px'
|
|
5
|
+
};
|
|
6
|
+
var firstTdStyle = {
|
|
7
|
+
width: '6em',
|
|
8
|
+
textTransform: 'capitalize'
|
|
9
|
+
};
|
|
10
|
+
var PropertyStyle = {
|
|
11
|
+
tableStyle: tableStyle,
|
|
12
|
+
firstTdStyle: firstTdStyle
|
|
13
|
+
};
|
|
14
|
+
export default PropertyStyle;
|