kitchen-simulator 4.4.6 → 5.0.0-new-api.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/es/LiteRenderer.js +15 -53
- package/es/assets/Window.hdr +2100 -0
- package/es/assets/img/default/maple.jpg +0 -0
- package/es/assets/img/default/steel.jpg +0 -0
- package/es/catalog/catalog.js +0 -2
- package/es/catalog/factories/area-factory-3d.js +0 -4
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/utils/exporter.js +2 -0
- package/es/catalog/utils/item-loader.js +0 -4
- package/es/class/area.js +0 -1
- package/es/class/export.js +1 -3
- package/es/class/item.js +17 -6
- package/es/components/content.js +1 -3
- package/es/components/style/export.js +2 -28
- package/es/components/viewer2d/line.js +2 -2
- package/es/components/viewer2d/viewer2d.js +0 -1
- package/es/components/viewer3d/front3D.js +1 -2
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/es/components/viewer3d/scene-creator.js +0 -1
- package/es/components/viewer3d/three-memory-cleaner.js +0 -14
- package/es/components/viewer3d/viewer3d.js +1 -1
- package/es/constants.js +11 -6
- package/es/devLiteRenderer.js +124 -84
- package/es/mappings/external-events/mapExternalEventPayload.js +28 -0
- package/es/mappings/external-events/mappers/addItemMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfMapper.js +86 -0
- package/es/mappings/external-events/mappers/ccdfToCDSMapper.js +31 -0
- package/es/mappings/external-events/mappers/changeDoorStyleMapper.js +37 -0
- package/es/mappings/external-events/mappers/loadProjectMapper.js +62 -0
- package/es/mappings/holesToCatalog.js +139 -0
- package/es/models.js +12 -1
- package/es/plugins/keyboard.js +1 -1
- package/es/reducers/export.js +2 -4
- package/es/reducers/items-reducer.js +1 -1
- package/es/reducers/project-reducer.js +1 -1
- package/es/reducers/reducer.js +2 -3
- package/es/shared/objects/immutable.js +3 -0
- package/es/utils/geometry.js +276 -74
- package/es/utils/history.js +2 -2
- package/es/utils/isolate-event-handler.js +57 -45
- package/es/utils/molding.js +5 -3
- package/lib/LiteRenderer.js +17 -55
- package/lib/assets/Window.hdr +2100 -0
- package/lib/assets/img/default/maple.jpg +0 -0
- package/lib/assets/img/default/steel.jpg +0 -0
- package/lib/catalog/catalog.js +0 -2
- package/lib/catalog/factories/area-factory-3d.js +0 -4
- package/lib/catalog/holes/door-double/door_double.png +0 -0
- package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
- package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/lib/catalog/holes/gate/gate.jpg +0 -0
- package/lib/catalog/holes/window-clear/texture.png +0 -0
- package/lib/catalog/holes/window-cross/texture.png +0 -0
- package/lib/catalog/holes/window-double-hung/texture.png +0 -0
- package/lib/catalog/holes/window-vertical/texture.png +0 -0
- package/lib/catalog/utils/exporter.js +2 -0
- package/lib/catalog/utils/item-loader.js +0 -4
- package/lib/class/area.js +0 -1
- package/lib/class/export.js +0 -8
- package/lib/class/item.js +17 -6
- package/lib/components/content.js +1 -3
- package/lib/components/style/export.js +1 -105
- package/lib/components/viewer2d/line.js +1 -1
- package/lib/components/viewer2d/viewer2d.js +0 -1
- package/lib/components/viewer3d/front3D.js +1 -2
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -90
- package/lib/components/viewer3d/scene-creator.js +0 -1
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -14
- package/lib/constants.js +16 -11
- package/lib/devLiteRenderer.js +126 -86
- package/lib/mappings/external-events/mapExternalEventPayload.js +33 -0
- package/lib/mappings/external-events/mappers/addItemMapper.js +92 -0
- package/lib/mappings/external-events/mappers/ccdfMapper.js +93 -0
- package/lib/mappings/external-events/mappers/ccdfToCDSMapper.js +37 -0
- package/lib/mappings/external-events/mappers/changeDoorStyleMapper.js +44 -0
- package/lib/mappings/external-events/mappers/loadProjectMapper.js +70 -0
- package/lib/mappings/holesToCatalog.js +148 -0
- package/lib/models.js +12 -1
- package/lib/reducers/export.js +1 -9
- package/lib/reducers/reducer.js +0 -1
- package/lib/shared/objects/immutable.js +9 -0
- package/lib/utils/geometry.js +276 -74
- package/lib/utils/history.js +1 -1
- package/lib/utils/isolate-event-handler.js +57 -45
- package/lib/utils/molding.js +5 -3
- package/package.json +1 -1
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -100
- package/es/catalog/properties/property-length-measure.js +0 -84
- package/es/catalog/properties/property-length-measure_hole.js +0 -100
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -79
- package/es/class/FuseUtils.js +0 -79
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input_2.js +0 -200
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-text-input.js +0 -69
- package/es/reducers/user-reducer.js +0 -41
- package/es/styles/export.js +0 -5
- package/es/styles/tabs.css +0 -40
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/properties/export.js +0 -81
- package/lib/catalog/properties/property-checkbox.js +0 -76
- package/lib/catalog/properties/property-color.js +0 -47
- package/lib/catalog/properties/property-enum.js +0 -58
- package/lib/catalog/properties/property-hidden.js +0 -27
- package/lib/catalog/properties/property-lenght-measure.js +0 -108
- package/lib/catalog/properties/property-length-measure.js +0 -92
- package/lib/catalog/properties/property-length-measure_hole.js +0 -108
- package/lib/catalog/properties/property-number.js +0 -56
- package/lib/catalog/properties/property-read-only.js +0 -34
- package/lib/catalog/properties/property-string.js +0 -56
- package/lib/catalog/properties/property-toggle.js +0 -47
- package/lib/catalog/properties/shared-property-style.js +0 -21
- package/lib/catalog/utils/FuseUtils.js +0 -87
- package/lib/class/FuseUtils.js +0 -87
- package/lib/components/style/button.js +0 -115
- package/lib/components/style/cancel-button.js +0 -29
- package/lib/components/style/content-container.js +0 -38
- package/lib/components/style/content-title.js +0 -35
- package/lib/components/style/delete-button.js +0 -34
- package/lib/components/style/form-block.js +0 -28
- package/lib/components/style/form-color-input.js +0 -34
- package/lib/components/style/form-label.js +0 -30
- package/lib/components/style/form-number-input_2.js +0 -209
- package/lib/components/style/form-select.js +0 -29
- package/lib/components/style/form-slider.js +0 -68
- package/lib/components/style/form-text-input.js +0 -78
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/styles/export.js +0 -13
- package/lib/styles/tabs.css +0 -40
|
Binary file
|
|
Binary file
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
};
|